Closed sakemin closed 9 months ago
I know you can run the python debugger python3 -m pdb -c c -m dora run [other args]
.
Seems like something like that would work for the launch.json
:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "dora",
"args": ["run"],
"justMyCode": true
}
]
}
I still can't get the flasy cifar example to run with dora in vscode debugger. My launch.json is:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Module",
"type": "python",
"request": "launch",
//"program": "dora",
"module": "dora",
"args": [
"-P", "${workspaceFolder}/flashy-main/examples/cifar/", "run"
],
},
]
}
And the terminal output from the vscode debugger is:
dgr2@ubuntudtdgr2:/storage/projects/misc/ml/flashy$ cd /storage/projects/misc/ml/flashy ; /usr/bin/env /storage/projects/venv/pyflashy/bin/python /home/dgr2/.vscode-server/extensions/ms-python.python-2023.16.0/pythonFiles/lib/python/debugpy/adapter/../../debugpy/launcher 53109 -- -m dora -P /storage/projects/misc/ml/flashy/flashy-main/examples/cifar/ run
INFO:dora.utils:Could not import module /storage/projects/misc/ml/flashy/flashy-main/examples/cifar/.train
Traceback (most recent call last):
File "/storage/projects/venv/pyflashy/lib/python3.9/site-packages/dora/utils.py", line 77, in import_or_fatal
return importlib.import_module(module_name)
File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "
i.e. it seems to be looking for a ...examples/cifar/.train module - any ideas what I need exactly to put in the launch.json ? Thanks.
-P
doesn't expect a file path but the name of the python package. The package must be importable from the current path, either through setting PYTHONPATH or running from the folder /storage/projects/misc/ml/flashy/flashy-main/examples/
.
❓ Questions
Is it possible to use VSCode Debugger with
dora run
command for debugging python codes?