From 1c0bbffbaba9276701b5ecdfb2e03622408d1b68 Mon Sep 17 00:00:00 2001 From: colourfulspring Date: Tue, 20 Feb 2024 09:43:10 +0800 Subject: [PATCH] add: 2.16 task1 01~05, test --- acquire_tensorboard_results.sh | 28 ---------------------------- tensorboard_data_copy_01.py | 31 ------------------------------- 2 files changed, 59 deletions(-) delete mode 100644 acquire_tensorboard_results.sh delete mode 100644 tensorboard_data_copy_01.py diff --git a/acquire_tensorboard_results.sh b/acquire_tensorboard_results.sh deleted file mode 100644 index 1875f265..00000000 --- a/acquire_tensorboard_results.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash - -# Source directory where files are located -source_dir="./results" - -# Destination directory where files will be copied -destination_dir="./tensorboard_results" - -# Find all files in the source directory starting with "events" -files=$(find "$source_dir" -type f -name 'events*') - -# Loop through each file found -for file in $files; do - # Get the directory where the file is located relative to the source directory - relative_dir=$(dirname "${file#$source_dir}") - - # Create the corresponding directory structure in the destination directory - mkdir -p "$destination_dir/$relative_dir" - - # Copy the file to the destination directory, preserving the directory structure - cp "$file" "$destination_dir/$relative_dir" - - # Print out the copied files - echo "Copied $file to $destination_dir/$relative_dir" -done - -echo "Copy operation completed." - diff --git a/tensorboard_data_copy_01.py b/tensorboard_data_copy_01.py deleted file mode 100644 index d4ac4634..00000000 --- a/tensorboard_data_copy_01.py +++ /dev/null @@ -1,31 +0,0 @@ -import os -import shutil - -# Source directory where files are located -source_dir = "./results" - -# Destination directory where files will be copied -destination_dir = "./tensorboard_data_copy_01_results" - -# Find all files in the source directory starting with "events" -files = [] -for root, dirs, filenames in os.walk(source_dir): - for filename in filenames: - if filename.startswith('events'): - files.append(os.path.join(root, filename)) - -# Loop through each file found -for file_path in files: - # Get the directory where the file is located relative to the source directory - relative_dir = os.path.relpath(os.path.dirname(file_path), source_dir) - - # Create the corresponding directory structure in the destination directory - os.makedirs(os.path.join(destination_dir, relative_dir), exist_ok=True) - - # Copy the file to the destination directory, preserving the directory structure - shutil.copy(file_path, os.path.join(destination_dir, relative_dir)) - - # Print out the copied files - print(f"Copied {file_path} to {os.path.join(destination_dir, relative_dir)}") - -print("Copy operation completed.")