Describe the bug
After running code cell 1.1 (load key dependencies), the following error message is generated.
FileNotFoundError Traceback (most recent call last)
/usr/lib/python3.7/shutil.py in move(src, dst, copy_function)
565 try:
--> 566 os.rename(src, real_dst)
567 except OSError:
FileNotFoundError: [Errno 2] No such file or directory: '/content/keras_yolo2/keras_yolov2/map_evaluation.py' -> '/content/keras-yolo2/map_evaluation.py'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
/tmp/ipykernel_84/3528458773.py in
156 #Now, we move the map_evaluation.py file to the main repo for this notebook.
157 #The source repo of the map_evaluation.py can then be ignored and is not further relevant for this notebook.
--> 158 shutil.move('/content/keras_yolo2/keras_yolov2/map_evaluation.py','/content/keras-yolo2/map_evaluation.py')
159
160 #We remove this branch from the notebook, to avoid confusion.
/usr/lib/python3.7/shutil.py in move(src, dst, copy_function)
578 rmtree(src)
579 else:
--> 580 copy_function(src, real_dst)
581 os.unlink(src)
582 return real_dst
/usr/lib/python3.7/shutil.py in copy2(src, dst, follow_symlinks)
264 if os.path.isdir(dst):
265 dst = os.path.join(dst, os.path.basename(src))
--> 266 copyfile(src, dst, follow_symlinks=follow_symlinks)
267 copystat(src, dst, follow_symlinks=follow_symlinks)
268 return dst
/usr/lib/python3.7/shutil.py in copyfile(src, dst, follow_symlinks)
118 os.symlink(os.readlink(src), dst)
119 else:
--> 120 with open(src, 'rb') as fsrc:
121 with open(dst, 'wb') as fdst:
122 copyfileobj(fsrc, fdst)
FileNotFoundError: [Errno 2] No such file or directory: '/content/keras_yolo2/keras_yolov2/map_evaluation.py'
I think this is to do with the differences in pathing between a google colab environment and a docker environment. the /content/ directory is never created, only the keras_yolo2 and keras-yolo2 directories that are supposed to be in /content/ are not found there, they're found in the 'home' directory of the ipynb and the docker environment.
there is at least one chdir command in the text of the notebook that changes the working directory to a subdirectory such as keras-yolo2; this is a persistent state, so later parts of the program run in keras_yolo2, when they should be running in / . It's not clear when a piece of code should be running in keras-yolo2 and when it should run in /, so it's difficult to know when to switch back and forth between directories.
I have tried to create a "home" variable which =os.getcwd() before any other code runs, but this is overwritten if I have to run the code more than once, as the cwd has changed when os.chdir is called, so home is overwritten when the cell runs again. There's going to be a way to say "if home doesn't exist, getcwd, and if it does exist do nothing", but even then, I'm still in the position that I don't get when code should be run in home, and when it should be run in any other directory.
To Reproduce
Steps to reproduce the behavior:
Create the docker environment using the YOLOV2 dl4mic notebook, then run cell 1.1.
Expected behavior
I expect the environment and temporary variables to be created in the correct places.
Desktop (please complete the following information):
- OS: windows 10
- Browser: firefox
Describe the bug
After running code cell 1.1 (load key dependencies), the following error message is generated.
FileNotFoundError Traceback (most recent call last)
/usr/lib/python3.7/shutil.py in move(src, dst, copy_function)
565 try:
--> 566 os.rename(src, real_dst)
567 except OSError:
FileNotFoundError: [Errno 2] No such file or directory: '/content/keras_yolo2/keras_yolov2/map_evaluation.py' -> '/content/keras-yolo2/map_evaluation.py'
During handling of the above exception, another exception occurred:
FileNotFoundError Traceback (most recent call last)
/tmp/ipykernel_84/3528458773.py in
156 #Now, we move the map_evaluation.py file to the main repo for this notebook.
157 #The source repo of the map_evaluation.py can then be ignored and is not further relevant for this notebook.
--> 158 shutil.move('/content/keras_yolo2/keras_yolov2/map_evaluation.py','/content/keras-yolo2/map_evaluation.py')
159
160 #We remove this branch from the notebook, to avoid confusion.
/usr/lib/python3.7/shutil.py in move(src, dst, copy_function)
578 rmtree(src)
579 else:
--> 580 copy_function(src, real_dst)
581 os.unlink(src)
582 return real_dst
/usr/lib/python3.7/shutil.py in copy2(src, dst, follow_symlinks)
264 if os.path.isdir(dst):
265 dst = os.path.join(dst, os.path.basename(src))
--> 266 copyfile(src, dst, follow_symlinks=follow_symlinks)
267 copystat(src, dst, follow_symlinks=follow_symlinks)
268 return dst
/usr/lib/python3.7/shutil.py in copyfile(src, dst, follow_symlinks)
118 os.symlink(os.readlink(src), dst)
119 else:
--> 120 with open(src, 'rb') as fsrc:
121 with open(dst, 'wb') as fdst:
122 copyfileobj(fsrc, fdst)
FileNotFoundError: [Errno 2] No such file or directory: '/content/keras_yolo2/keras_yolov2/map_evaluation.py'
I think this is to do with the differences in pathing between a google colab environment and a docker environment. the /content/ directory is never created, only the keras_yolo2 and keras-yolo2 directories that are supposed to be in /content/ are not found there, they're found in the 'home' directory of the ipynb and the docker environment.
there is at least one chdir command in the text of the notebook that changes the working directory to a subdirectory such as keras-yolo2; this is a persistent state, so later parts of the program run in keras_yolo2, when they should be running in / . It's not clear when a piece of code should be running in keras-yolo2 and when it should run in /, so it's difficult to know when to switch back and forth between directories.
I have tried to create a "home" variable which =os.getcwd() before any other code runs, but this is overwritten if I have to run the code more than once, as the cwd has changed when os.chdir is called, so home is overwritten when the cell runs again. There's going to be a way to say "if home doesn't exist, getcwd, and if it does exist do nothing", but even then, I'm still in the position that I don't get when code should be run in home, and when it should be run in any other directory.
To Reproduce
Steps to reproduce the behavior:
Create the docker environment using the YOLOV2 dl4mic notebook, then run cell 1.1.
Expected behavior
I expect the environment and temporary variables to be created in the correct places.
Desktop (please complete the following information):