AayushKrChaudhary / RITnet

This is a winning model of OpenEDS Semantic Segmentation Challenge
MIT License
70 stars 28 forks source link

Profiling Issue #1

Closed yingj4 closed 4 years ago

yingj4 commented 4 years ago

Hi, I am Ying, a computer architect from UIUC. I am impressed by your work, and I hope to profile you program. When I followed your instructions and run the program, it was perfect. However, when I used cProfile which is the Python profiler (https://stackoverflow.com/questions/582336/how-can-you-profile-a-python-script), I had a bug:

Traceback (most recent call last):
  File "/home/yingj4/anaconda3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/yingj4/anaconda3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/yingj4/anaconda3/lib/python3.7/cProfile.py", line 185, in <module>
    main()
  File "/home/yingj4/anaconda3/lib/python3.7/cProfile.py", line 178, in main
    runctx(code, globs, None, options.outfile, options.sort)
  File "/home/yingj4/anaconda3/lib/python3.7/cProfile.py", line 20, in runctx
    filename, sort)
  File "/home/yingj4/anaconda3/lib/python3.7/profile.py", line 62, in runctx
    prof.runctx(statement, globals, locals)
  File "/home/yingj4/anaconda3/lib/python3.7/cProfile.py", line 100, in runctx
    exec(cmd, globals, locals)
  File "test.py", line 62, in <module>
    if not os.path.exists(filename):
  File "/home/yingj4/anaconda3/lib/python3.7/genericpath.py", line 19, in exists
    os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

Can you help me solve this problem? I also tried another profiler (PyProf by NVIDIA: https://github.com/NVIDIA/apex/tree/master/apex/pyprof). It stopped due to the same error. Thanks a lot!

AayushKrChaudhary commented 4 years ago

simply try changing .. parser.add_argument('--load', type=str, default=None, help='load checkpoint file name') to parser.add_argument('--load', type=str, default='best_model.pkl', help='load checkpoint file name')