Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用paddlex训练图片多标签识别报错:NotADirectoryError: [WinError 267] 目录名称无效 #2512

Closed
4 tasks
syge opened this issue Nov 19, 2024 · 5 comments
Assignees
Labels
bug Something isn't working cv

Comments

@syge
Copy link

syge commented Nov 19, 2024

Checklist:

描述问题

复现

  1. 您是否已经正常运行我们提供的教程

  2. 您是否在教程的基础上修改代码内容?还请您提供运行的代码

  3. 您使用的数据集是?

  4. 请提供您出现的报错信息及相关log

环境

  1. 请提供您使用的PaddlePaddle和PaddleX的版本号

  2. 请提供您使用的操作系统信息,如Linux/Windows/MacOS

  3. 请问您使用的Python版本是?

  4. 请问您使用的CUDA/cuDNN的版本号是?

使用python版本是:3.10.14

跑的就是提供的示例:python main.py -c paddlex/configs/multilabel_classification/PP-LCNet_x1_0_ML.yaml -o Global.mode=train -o Global.dataset_dir=./dataset/mlcls_nus_examples

配置文件信息:
Global:
model: PP-LCNet_x1_0_ML

mode: check_dataset

mode: train
dataset_dir: dataset/mlcls_nus_examples
device: gpu:0
output: "output"

CheckDataset:
convert:
enable: False
src_dataset_type: null
split:
enable: False
train_percent: null
val_percent: null

Train:
num_classes: 33
epochs_iters: 20
batch_size: 32
learning_rate: 0.1
pretrain_weight_path: https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_ML_pretrained.pdparams
warmup_steps: 5
resume_path: null
log_interval: 20
eval_interval: 1
save_interval: 1

Evaluate:
weight_path: "output/best_model/best_model.pdparams"
log_interval: 1

Export:
weight_path: https://paddle-model-ecology.bj.bcebos.com/paddlex/official_pretrained_model/PP-LCNet_x1_0_ML_pretrained.pdparams

Predict:
batch_size: 1
model_dir: "output/best_model/inference"
input: "https://paddle-model-ecology.bj.bcebos.com/paddlex/imgs/demo_image/general_image_classification_001.jpg"
kernel_option:
run_mode: paddle

具体报错信息是:
Traceback (most recent call last):
File "D:\python-application\PaddleX\paddlex\utils\result_saver.py", line 29, in wrap
result = func(self, *args, **kwargs)
File "D:\python-application\PaddleX\paddlex\engine.py", line 41, in run
self._model.train()
File "D:\python-application\PaddleX\paddlex\model.py", line 94, in train
trainer.train()
File "D:\python-application\PaddleX\paddlex\modules\base\trainer.py", line 71, in train
train_result = self.pdx_model.train(**train_args)
File "D:\python-application\PaddleX\paddlex\repo_apis\PaddleClas_api\cls\model.py", line 123, in train
return self.runner.train(
File "D:\python-application\PaddleX\paddlex\repo_apis\PaddleClas_api\cls\runner.py", line 50, in train
return self.run_cmd(
File "D:\python-application\PaddleX\paddlex\repo_apis\base\runner.py", line 344, in run_cmd
retcode = asyncio.run(
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\base_events.py", line 649, in run_until_complete
return future.result()
File "D:\python-application\PaddleX\paddlex\repo_apis\base\runner.py", line 308, in _tee_proc_call
proc = await proc_call
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\subprocess.py", line 218, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\base_events.py", line 1681, in subprocess_exec
transport = await self._make_subprocess_transport(
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\windows_events.py", line 399, in _make_subprocess_transport
transp = _WindowsSubprocessTransport(self, protocol, args, shell,
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\base_subprocess.py", line 36, in init
self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\windows_events.py", line 901, in _start
File "D:\software\aconda\envs\dbgpt_env\lib\asyncio\windows_utils.py", line 153, in init
super().init(args, stdin=stdin_rfd, stdout=stdout_wfd,
File "D:\software\aconda\envs\dbgpt_env\lib\subprocess.py", line 971, in init
File "D:\software\aconda\envs\dbgpt_env\lib\subprocess.py", line 1456, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
NotADirectoryError: [WinError 267] 目录名称无效。
Unknown option: -e

@changdazhou
Copy link
Collaborator

尝试将dataset_dir的路径修改成windows目录表达形式看看

@syge
Copy link
Author

syge commented Nov 20, 2024

改成使用绝对路径,依然报上述错误
python main.py -c paddlex/configs/multilabel_classification/PP-LCNet_x1_0_ML.yaml -o Global.mode=train -o Global.dataset_dir=D:\python-application\PaddleX\dataset\mlcls_nus_examples

@changdazhou
Copy link
Collaborator

这样试一下呢:D:\python-application\PaddleX\dataset\mlcls_nus_examples

@AmberC0209 AmberC0209 added bug Something isn't working cv labels Nov 27, 2024
@TingquanGao
Copy link
Collaborator

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

@renchengwei
Copy link

改成使用绝对路径,依然报上述错误 python main.py -c paddlex/configs/multilabel_classification/PP-LCNet_x1_0_ML.yaml -o Global.mode=train -o Global.dataset_dir=D:\python-application\PaddleX\dataset\mlcls_nus_examples

请问您最终解决这个问题了吗?我现在也遇到了这个问题,请教您一下,谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cv
Projects
None yet
Development

No branches or pull requests

5 participants