开发者社区 > ModelScope模型即服务 > 正文

modelscope训练完一直出现同一个错误怎么回事?

modelscope训练完一直出现这个错误2024-08-15 11:43:24,103 - modelscope - INFO - Train finished. Uploading models, waiting...
Traceback (most recent call last):
File "", line 1, in
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 120, in spawn_main
exitcode = _main(fd, parent_sentinel)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 129, in _main
prepare(preparation_data)
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 240, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 291, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 291, in run_path
File "", line 98, in _run_module_code
File "", line 88, in _run_code
File "d:\geoner\GeoNER-jstrain\src\model\train.py", line 86, in
finetune(
File "d:\geoner\GeoNER-jstrain\src\model\train.py", line 31, in finetune
trainer.train()
File "D:\ProgramData.conda\envs\mt5py\Lib\site-packages\modelscope\trainers\trainer.py", line 711, in train
self.train_loop(self.train_dataloader)
File "D:\ProgramData.conda\envs\mt5py\Lib\site-packages\modelscope\trainers\trainer.py", line 1250, in train_loop
self.invoke_hook(TrainerStages.after_run)
File "D:\ProgramData.conda\envs\mt5py\Lib\site-packages\modelscope\trainers\trainer.py", line 1395, in invoke_hook
getattr(hook, fn_name)(self)
File "D:\ProgramData.conda\envs\mt5py\Lib\site-packages\modelscope\trainers\hooks\checkpoint\checkpoint_hook.py", line 188, in after_run
push_to_hub_in_queue(
File "D:\ProgramData.conda\envs\mt5py\Lib\site-packages\modelscope\hub\push_to_hub.py", line 171, in push_to_hub_in_queue
_manager = Manager()
^^^^^^^^^
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\context.py", line 57, in Manager
m.start()
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\managers.py", line 563, in start
self._process.start()
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
^^^^^^^^^^^^^^^^^
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\context.py", line 336, in _Popen
return Popen(process_obj)
^^^^^^^^^^^^^^^^^^
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\popen_spawn_win32.py", line 45, in init
prep_data = spawn.get_preparation_data(process_obj._name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 158, in get_preparation_data
_check_not_importing_main()
File "D:\ProgramData.conda\envs\mt5py\Lib\multiprocessing\spawn.py", line 138, in _check_not_importing_main
raise RuntimeError('''
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

展开
收起
防火防爆 2024-08-16 16:25:34 52 0
1 条回答
写回答
取消 提交回答
  • 您看下output文件夹下有pytorch_model.bin这个文件没。有的话,用这个文件推理就行。早期的一些模型windows上训练会报错。此回答整理自钉钉群“魔搭ModelScope开发者联盟群 ①”

    2024-08-28 11:27:00
    赞同 展开评论 打赏

ModelScope旨在打造下一代开源的模型即服务共享平台,为泛AI开发者提供灵活、易用、低成本的一站式模型服务产品,让模型应用更简单!欢迎加入技术交流群:微信公众号:魔搭ModelScope社区,钉钉群号:44837352

相关电子书

更多
视觉AI能力的开放现状及ModelScope实战 立即下载
ModelScope助力语音AI模型创新与应用 立即下载
低代码开发师(初级)实战教程 立即下载