快速编辑:这个项目是由Linux制成的,我正在使用Windows 10。
我开始从Github开展一个深度学习项目。在调整和安装Python,Miniconda,VENV,需要包裹,并根据作者的要求调整项目中的路径,是时候训练模型了。作者使用makefile来训练,提取功能等。以下命令用于训练模型 make train
,并且该火车的完整代码在makefile中是
CONFIG_PATH=./experiments/configs/
CONFIG_NAME=seld.yml
OUTPUT=./outputs # Directory to save output
EXP_SUFFIX=_test # the experiment name = CONFIG_NAME + EXP_SUFFIX
RESUME=False
GPU_NUM=0 # Set to -1 if there is no GPU
.phony: train
train:
PYTHONPATH=$(shell cd) CUDA_VISIBLE_DEVICES="${GPU_NUM}" python experiments/train.py --exp_config="${CONFIG_PATH}${CONFIG_NAME}" --exp_group_dir=$(OUTPUT) --exp_suffix=$(EXP_SUFFIX) --resume=$(RESUME)
PS:最后一行是第38行,
当我使用制作火车
时,会发生以下错误:
> make train
PYTHONPATH=D:\GUC\Semester 8 (Bachelor)\SALSA CUDA_VISIBLE_DEVICES="0 " python experiments/train.py --exp_config="./experiments/configs/seld.yml" --exp_group_dir=./outputs --exp_suffix=_test --resume=False
'PYTHONPATH' is not recognized as an internal or external command,
operable program or batch file.
make: *** [Makefile:38: train] Error 1
在系统环境变量中进行编辑和更改之后,这是我的用户和系统变量中的我的路径和pythonpath。
PS:
- “ Salsa”是Conda Env的名称。
- 我添加了许多希望它能起作用的路径,但事实并非如此。
- 在第一张图像的第三个路径中,Minconda是这样做的,库中没有“ USR”文件夹。
image 1-用户变量中的路径
图像2-用户变量中的pythonpath
图像4-系统变量中的pythonpath
现在,我没有在网上找到对我有用的任何解决方案。由于问题指出“未识别pythonpath”,因此我在网上应用了每个可用的修复程序来编辑系统env变量,但仍未解决。
另外,由于某种原因, $(Shell PWD)
确实会返回路径,但是如果我在终端中编写 pwd
,则可以正常工作。
我尝试使用Miniconda终端,VSCODE和PYCHARM,但所有这些都遇到了相同的错误。我什至调整了VSCODE的设置,以使默认的Python解释器python.exe在我的Miniconda中。但仍然...
Quick Edit: This project was made with linux, and I am using windows 10.
I started working on a deep learning project forked from github. After adjusting and installing python, miniconda, venv, required packages, and adjusting paths in the project as requested by the author, it was time to train the model. The author uses a Makefile to train, extract features, etc.. The following command is used to train the model make train
, and the full code of this train part in the Makefile is
CONFIG_PATH=./experiments/configs/
CONFIG_NAME=seld.yml
OUTPUT=./outputs # Directory to save output
EXP_SUFFIX=_test # the experiment name = CONFIG_NAME + EXP_SUFFIX
RESUME=False
GPU_NUM=0 # Set to -1 if there is no GPU
.phony: train
train:
PYTHONPATH=$(shell cd) CUDA_VISIBLE_DEVICES="${GPU_NUM}" python experiments/train.py --exp_config="${CONFIG_PATH}${CONFIG_NAME}" --exp_group_dir=$(OUTPUT) --exp_suffix=$(EXP_SUFFIX) --resume=$(RESUME)
PS: the last line is line 38
When I use make train
, the following error happens:
> make train
PYTHONPATH=D:\GUC\Semester 8 (Bachelor)\SALSA CUDA_VISIBLE_DEVICES="0 " python experiments/train.py --exp_config="./experiments/configs/seld.yml" --exp_group_dir=./outputs --exp_suffix=_test --resume=False
'PYTHONPATH' is not recognized as an internal or external command,
operable program or batch file.
make: *** [Makefile:38: train] Error 1
After editing and changing a lot in the system environmental variables, this is currently my path and pythonpath in both the user and system variables.
PS:
- "salsa" is the name of the conda env.
- I added a lot of paths hoping for it to work, but it didn't.
- In the third path of the first image, that miniconda was the one that did it, there is no "usr" folder inside Library.
Image 1 - path in user variables
Image 2 - pythonpath in user variables
Image 3 - path in system variables
Image 4 - pythonpath in system variables
Right now, I found no fix whatsoever online that worked for me. Since the problem states that "PYTHONPATH is not recognized", I applied every fix available online for editing the system env variables, but still not fixed.
Also, for some reason, the $(shell pwd)
does return the path, but if I write pwd
in the terminal, it works fine.
I tried using the miniconda terminal, vscode, and pycharm, but all yeld to the same error. I even adjusted vscode's settings to make the default python interpreter the python.exe that is in my env in miniconda. But still...
发布评论