datawhalechina / self-llm

《开源大模型食用指南》基于Linux环境快速部署开源大模型,更适合**宝宝的部署教程

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

我在微调LLAMA3的时候出现NotImplementedError: Cannot copy out of meta tensor; no data!

Mr-Lnan opened this issue · comments

trainer = Trainer( model=model, args=args, train_dataset=tokenized_id, data_collator=DataCollatorForSeq2Seq(tokenizer=tokenizer, padding=True), )
这里报错NotImplementedError: Cannot copy out of meta tensor; no data!,可是我输出model,args,tokenized_id,tokenizer全是正常的

可以把详细的报错代码贴一下嘛,看不太出来这是什么原因

我重新配置环境之后可以了

我重新配置环境之后可以了

请问是包的版本导致的么?我也出现这中情况了。

我在kaggle中跑这个代码出现这个问题,现在重新配置环境之后也还是出现这个问题,昨天只好了一次,用autodl不会有这个错误

commented

我重新配置环境之后可以了

好了之后, 可以贴一下包的版本吗,pip freeze, 我也遇到同样的错误 @Mr-Lnan

我重新配置环境之后可以了

好了之后, 可以贴一下包的版本吗,pip freeze, 我也遇到同样的错误 @Mr-Lnan

absl-py==2.0.0 accelerate==0.29.3 addict==2.4.0 aiohttp==3.9.5 aiosignal==1.3.1 aliyun-python-sdk-core==2.15.1 aliyun-python-sdk-kms==2.16.3 altair==5.3.0 anyio==4.2.0 argon2-cffi==23.1.0 argon2-cffi-bindings==21.2.0 arrow==1.3.0 asttokens==2.4.1 async-lru==2.0.4 async-timeout==4.0.3 attrs==23.2.0 Babel==2.14.0 beautifulsoup4==4.12.2 bleach==6.1.0 blinker==1.8.2 brotlipy==0.7.0 cachetools==5.3.2 certifi @ file:///croot/certifi_1671487769961/work/certifi cffi @ file:///croot/cffi_1670423208954/work charset-normalizer @ file:///tmp/build/80754af9/charset-normalizer_1630003229654/work click==8.1.7 comm==0.2.1 conda==22.11.1 conda-content-trust @ file:///tmp/abs_5952f1c8-355c-4855-ad2e-538535021ba5h26t22e5/croots/recipe/conda-content-trust_1658126371814/work conda-package-handling @ file:///croot/conda-package-handling_1666940373510/work contourpy==1.2.0 crcmod==1.7 cryptography @ file:///croot/cryptography_1665612644927/work cycler==0.12.1 datasets==2.19.0 debugpy==1.8.0 decorator==5.1.1 defusedxml==0.7.1 dill==0.3.6 einops==0.8.0 exceptiongroup==1.2.0 executing==2.0.1 fastjsonschema==2.19.1 filelock==3.13.1 flash-attn==2.5.8 fonttools==4.47.0 fqdn==1.5.1 frozenlist==1.4.1 fsspec==2023.12.2 gast==0.5.4 gitdb==4.0.11 GitPython==3.1.43 google-auth==2.26.1 google-auth-oauthlib==1.2.0 grpcio==1.60.0 huggingface-hub==0.23.0 idna @ file:///croot/idna_1666125576474/work importlib-metadata==6.11.0 ipykernel==6.28.0 ipython==8.20.0 ipywidgets==8.1.1 isoduration==20.11.0 jedi==0.19.1 Jinja2==3.1.2 jmespath==0.10.0 json5==0.9.14 jsonpointer==2.4 jsonschema==4.20.0 jsonschema-specifications==2023.12.1 jupyter-events==0.9.0 jupyter-lsp==2.2.1 jupyter_client==8.6.0 jupyter_core==5.7.1 jupyter_server==2.12.2 jupyter_server_terminals==0.5.1 jupyterlab==4.0.10 jupyterlab-language-pack-zh-CN==4.0.post6 jupyterlab-widgets==3.0.9 jupyterlab_pygments==0.3.0 jupyterlab_server==2.25.2 kiwisolver==1.4.5 Markdown==3.5.1 markdown-it-py==3.0.0 MarkupSafe==2.1.3 matplotlib==3.8.2 matplotlib-inline==0.1.6 mdurl==0.1.2 mistune==3.0.2 modelscope==1.9.5 mpmath==1.3.0 multidict==6.0.5 multiprocess==0.70.14 nbclient==0.9.0 nbconvert==7.14.0 nbformat==5.9.2 nest-asyncio==1.5.8 networkx==3.2.1 ninja==1.11.1.1 notebook_shim==0.2.3 numpy==1.26.3 oauthlib==3.2.2 oss2==2.18.5 overrides==7.4.0 packaging==23.2 pandas==2.2.2 pandocfilters==1.5.0 parso==0.8.3 peft==0.10.0 pexpect==4.9.0 Pillow==9.5.0 platformdirs==4.1.0 pluggy @ file:///tmp/build/80754af9/pluggy_1648024709248/work prometheus-client==0.19.0 prompt-toolkit==3.0.43 protobuf==4.23.4 psutil==5.9.7 ptyprocess==0.7.0 pure-eval==0.2.2 pyarrow==16.0.0 pyarrow-hotfix==0.6 pyasn1==0.5.1 pyasn1-modules==0.3.0 pycosat @ file:///croot/pycosat_1666805502580/work pycparser @ file:///tmp/build/80754af9/pycparser_1636541352034/work pycryptodome==3.20.0 pydeck==0.9.1 Pygments==2.17.2 Pympler==1.0.1 pyOpenSSL @ file:///opt/conda/conda-bld/pyopenssl_1643788558760/work pyparsing==3.1.1 PySocks @ file:///home/builder/ci_310/pysocks_1640793678128/work python-dateutil==2.8.2 python-json-logger==2.0.7 pytz==2024.1 pytz-deprecation-shim==0.1.0.post0 PyYAML==6.0.1 pyzmq==25.1.2 referencing==0.32.1 regex==2024.5.10 requests==2.31.0 requests-oauthlib==1.3.1 rfc3339-validator==0.1.4 rfc3986-validator==0.1.1 rich==13.7.1 rpds-py==0.16.2 rsa==4.9 ruamel.yaml @ file:///croot/ruamel.yaml_1666304550667/work ruamel.yaml.clib @ file:///croot/ruamel.yaml.clib_1666302247304/work safetensors==0.4.3 scipy==1.13.0 Send2Trash==1.8.2 sentencepiece==0.1.99 simplejson==3.19.2 six @ file:///tmp/build/80754af9/six_1644875935023/work smmap==5.0.1 sniffio==1.3.0 sortedcontainers==2.4.0 soupsieve==2.5 stack-data==0.6.3 streamlit==1.24.0 supervisor==4.2.5 sympy==1.12 tenacity==8.3.0 tensorboard==2.15.1 tensorboard-data-server==0.7.2 terminado==0.18.0 tinycss2==1.2.1 tokenizers==0.19.1 toml==0.10.2 tomli==2.0.1 toolz @ file:///croot/toolz_1667464077321/work torch @ http://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-linux_x86_64.whl torchvision @ http://download.pytorch.org/whl/cu121/torchvision-0.16.2%2Bcu121-cp310-cp310-linux_x86_64.whl tornado==6.4 tqdm @ file:///opt/conda/conda-bld/tqdm_1664392687731/work traitlets==5.14.1 transformers==4.40.2 triton==2.1.0 types-python-dateutil==2.8.19.20240106 typing_extensions==4.9.0 tzdata==2024.1 tzlocal==4.3.1 uri-template==1.3.0 urllib3 @ file:///croot/urllib3_1670526988650/work validators==0.28.1 watchdog==4.0.0 wcwidth==0.2.13 webcolors==1.13 webencodings==0.5.1 websocket-client==1.7.0 Werkzeug==3.0.1 widgetsnbextension==4.0.9 xxhash==3.4.1 yapf==0.40.2 yarl==1.9.4 zipp==3.18.1这是我目前的环境

commented

@Mr-Lnan 多谢 不过没解决

commented

这个可以 https://stackoverflow.com/a/78082205

 model = AutoModelForCausalLM.from_pretrained(model_path, trust_remote_code=True, torch_dtype=torch.half, device_map="cuda")