我正在尝试调试一些Python代码,通过在bash中输入以下内容即可无问题地运行:
CUDA_VISIBLE_DEVICES=0 \
python test_multi.py \
--experiment_name 128_shortcut1_inject1_none \
--test_atts Eyeglasses \
--test_ints -1.0
我已经为VScode创建了这个JSON配置文件:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "<absolute_path>/test_multi.py",
"console": "integratedTerminal",
"env": [{ "name":"CUDA_VISIBLE_DEVICES", "value":0}],
"args": ["--experiment_name 128_shortcut1_inject1_none", "--test_atts Eyeglasses", "--test_ints -1"]
}
]
}
但我一直收到以下错误提示test_multi.py: error: 未识别的参数: --experiment_name 128_shortcut1_inject1_none --test_atts Eyeglasses --test_ints -1
env": {"PYTHONPATH":".", "CUDA_VISIBLE_DEVICES": "0"}
- jef