Please provide a clear and concise description of what the question is.
大佬,您好!
请问我在使用training_qwen_demo.py文件对qwen2.5-7b进行微调时候,报错NotImplementedError: Cannot copy out of meta tensor; no data!,请问如何解决,报错信息如下
Traceback (most recent call last):
File "/root/dataDisk/pycorrector/examples/gpt/training_qwen_demo.py", line 75, in
main()
File "/root/dataDisk/pycorrector/examples/gpt/training_qwen_demo.py", line 56, in main
model.train_model(args.train_file, eval_data=args.test_file)
File "/root/.local/lib/python3.10/site-packages/pycorrector/gpt/gpt_model.py", line 445, in train_model
trainer = SavePeftModelTrainer(
File "/root/.local/lib/python3.10/site-packages/transformers/trainer.py", line 554, in init
self._move_model_to_device(model, args.device)
File "/root/.local/lib/python3.10/site-packages/transformers/trainer.py", line 802, in _move_model_to_device
model = model.to(device)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in to
return self._apply(convert)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
[Previous line repeated 5 more times]
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 833, in _apply
param_applied = fn(param)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
NotImplementedError: Cannot copy out of meta tensor; no data!
Describe the Question
Please provide a clear and concise description of what the question is. 大佬,您好! 请问我在使用training_qwen_demo.py文件对qwen2.5-7b进行微调时候,报错NotImplementedError: Cannot copy out of meta tensor; no data!,请问如何解决,报错信息如下 Traceback (most recent call last): File "/root/dataDisk/pycorrector/examples/gpt/training_qwen_demo.py", line 75, in
main()
File "/root/dataDisk/pycorrector/examples/gpt/training_qwen_demo.py", line 56, in main
model.train_model(args.train_file, eval_data=args.test_file)
File "/root/.local/lib/python3.10/site-packages/pycorrector/gpt/gpt_model.py", line 445, in train_model
trainer = SavePeftModelTrainer(
File "/root/.local/lib/python3.10/site-packages/transformers/trainer.py", line 554, in init
self._move_model_to_device(model, args.device)
File "/root/.local/lib/python3.10/site-packages/transformers/trainer.py", line 802, in _move_model_to_device
model = model.to(device)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in to
return self._apply(convert)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
[Previous line repeated 5 more times]
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 833, in _apply
param_applied = fn(param)
File "/opt/conda/envs/py10/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
NotImplementedError: Cannot copy out of meta tensor; no data!