Skip to content

Commit

Permalink
update main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ultimate-Storm committed Jul 4, 2024
1 parent 8abd4c7 commit f946280
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions workspace/odelia-breast-mri/model/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,25 +223,7 @@ def on_validation_epoch_end(self, trainer, pl_module):
swarmCallback.on_train_end()
model.save_best_checkpoint(trainer.logger.log_dir, checkpointing.best_model_path)
model.save_last_checkpoint(trainer.logger.log_dir, checkpointing.last_model_path)
'''
import subprocess

# Get the container ID for the latest user-env container
get_container_id_command = 'docker ps -a --filter "name=us*" --format "{{.ID}}" | head -n 1'
container_id = subprocess.check_output(get_container_id_command, shell=True, text=True).strip()
# Get the latest log for the user-env container
get_logs_command = f"docker logs {container_id}"
logs_process = subprocess.Popen(get_logs_command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# Print and log the output
with open(os.path.join(path_run_dir,"container_logs.txt"), "w") as log_file:
for line in logs_process.stdout:
line = line.decode("utf-8").rstrip()
print(line)
log_file.write(line + "\n")
'''

predict(path_run_dir, os.path.join(dataDir, task_data_name,'test'), model_name, last_flag=False, prediction_flag = prediction_flag)
predict(path_run_dir, os.path.join(dataDir, task_data_name,'test'), model_name, last_flag=True, prediction_flag = prediction_flag)

print('Training completed successfully')

0 comments on commit f946280

Please sign in to comment.