PyCharm:带逗号的环境变量(THEANO_FLAGS)

时间:2017-10-06 05:51:29

标签: python intellij-idea pycharm

我目前正在尝试在PyCharm中运行一个theano程序,该程序通过ssh链接到远程计算机。

如果我们在本地计算机上运行此程序,则使用

THEANO_FLAGS="floatX=float32,device=gpu" python train.py IMDB 10

但这是PyCharm中的问题:

我手动将env设置如下,

enter image description here

当我运行它时,错误显示: ValueError: Invalid value ("float32,device=gpu") for configuration variable "floatX". Valid options are ('float64', 'float32', 'float16')

然后我登录到远程服务器,进程详细信息是

tanhao 30033 0.0 0.0 14288 3196 pts/27 Ss+ 13:33 0:00 bash -c cd /home/tanhao/github/NSC/NSC+UPA/src; env "IDE_PROJECT_ROOTS"="/home/tanhao/github/NSC" "IPYTHONENABLE"="True" "PYTHONPATH"="/home/tanhao/github/NSC:/home/tanhao/.pycharm_helpers/pydev" "PYTHONUNBUFFERED"="1" "PYCHARM_HOSTED"="1" "PYTHONIOENCODING"="UTF-8" "LIBRARY_ROOTS"="C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/-166109868;C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/1548805601;C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/58451930;C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/-507136200;C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/-771155378;C:/Users/htan/.PyCharm2016.2/system/remote_sources/-1562167050/setuptools-27.2.0-py2.7.egg!/;C:/Users/htan/.PyCharm2016.2/system/python_stubs/-1562167050;C:/Program Files (x86)/JetBrains/PyCharm 2016.2.3/helpers/python-skeletons" "PYTHONDONTWRITEBYTECODE"="1" "JETBRAINS_REMOTE_RUN"="1" "THEANO_FLAGS"="\"floatX=float32,device=gpu\"" /home/tanhao/anaconda2/bin/python -u /home/tanhao/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client '0.0.0.0' --port 40241 --file /home/tanhao/github/NSC/NSC+UPA/src/train.py IMDB2 10 tanhao 30034 2.7 0.0 451756 51880 pts/27 Sl+ 13:33 0:03 /home/tanhao/anaconda2/bin/python -u /home/tanhao/.pycharm_helpers/pydev/pydevd.py --multiproc --qt-support --client 0.0.0.0 --port 40241 --file /home/tanhao/github/NSC/NSC+UPA/src/train.py IMDB2 10

1 个答案:

答案 0 :(得分:1)

你应该尝试删除这样的双引号:

floatX=float32, device=gpu

您在“环境变量”值中插入的内容已经被评估为字符串。