Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some errors in test.py for training on Windows #90

Closed
rtrahms opened this issue Feb 11, 2019 · 4 comments
Closed

Some errors in test.py for training on Windows #90

rtrahms opened this issue Feb 11, 2019 · 4 comments

Comments

@rtrahms
Copy link

rtrahms commented Feb 11, 2019

Hi all -
Nice job on implementing YoloV3 in PyTorch/CUDA! I am using it in a Windows Python 3.7 environment, and have successfully trained and tested a custom network using this framework!

I did find some bugs in the master though.

  1. Some os operations ('cp', 'rm') not supported in Windows - I could hack around these.
  2. Bug on sending data_cfg dictionary to test.test(), which is expecting a string to start (also calls load_data_cfg()). I did hack around this one by storing and passing the path string.

A somewhat unrelated bug is the use of the name test.py. I was unable to debug this with spyder until I changed the name of this module to a more unique type (I used yolo_test.py, and debugging worked). I am wondering if there is a reserved word conflict with the name test.

Thanks!
Rob

@glenn-jocher
Copy link
Member

glenn-jocher commented Feb 11, 2019

Thanks for the feedback! I fixed your #2, yes good catch. The dictionary was named the same as the string, poor coding on my part.

#1 will take a bit of effort to resolve, as there are various areas around the code that stitch together path names under the linux assumption. But you are not the first one to mention this. I will leave the comment open until I resolve this, presumably through the more liberal use of, os.path.join() and os.sep().

About your last comment I had not heard this from anyone else yet, so I will leave as is for now. Thanks again.

@Ttayu
Copy link
Contributor

Ttayu commented Feb 12, 2019

we can use pathlib of standard library instead of os in python3(>=3.4).
https://medium.com/@ageitgey/python-3-quick-tip-the-easy-way-to-deal-with-file-paths-on-windows-mac-and-linux-11a072b58d5f

@glenn-jocher
Copy link
Member

@Ttayu thanks for the article, I was not aware of the new pathlib functionality. This seems like a good solution, I'll see what I can do to integrate it.

@glenn-jocher
Copy link
Member

@rtrahms I updated detect.py to be fully Windows compatible now, using the pathlib standard library suggested by @Ttayu. I replaced your line in question with the following os agnostic shutil command.

yolov3/detect.py

Lines 25 to 26 in 7d58788

shutil.rmtree(output) # delete output folder
os.makedirs(output) # make new output folder

Are there any other incompatibilities in test.py or train.py you found? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants