vacancy/Jacinle

how to debug ?

Closed this issue · 2 comments

how to debug when using jac-run xxx.py to replace python3 xxx.py on pycharm?

What jac-run does is basically

  • runs an initialization script to set up environment variables, add libraries to PYTHONPATH, etc.
  • call python to execute the file

There is a utility script that can export the initialization script: jac-export-init. Running jac-export-init in your project folder gets you all the commands ran before the python script, primarily the PYTHONPATHs. You can set up the debugger in other IDEs accordingly, I guess.

This is an example bash script I exported:

export PYTHONPATH=<my_home_path>/projects/Jacinle:./:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/pytorch_reservoir:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/AdvancedIndexing-PyTorch:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/Synchronized-BatchNorm-PyTorch:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/PreciseRoIPooling/pytorch:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/SceneGraphParser:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/JacMLDash:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/PyGCO:$PYTHONPATH
export PYTHONPATH=<my_home_path>/projects/Jacinle/vendors/PyPatchMatch:$PYTHONPATH

Thanks.