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

NotImplementedError: Cannot copy out of meta tensor; no data! #348

Open
chilljudaoren opened this issue Jan 15, 2025 · 0 comments
Open

NotImplementedError: Cannot copy out of meta tensor; no data! #348

chilljudaoren opened this issue Jan 15, 2025 · 0 comments

Comments

@chilljudaoren
Copy link

Before you open an issue, please check if a similar issue already exists or has been closed before.

Traceback (most recent call last):
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3508, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
TestOtter(checkpoint=args.checkpoint)
File "/home/czh/Otter-main/pipeline/demos/demo_models.py", line 38, in init
self.model = OtterForConditionalGeneration.from_pretrained(checkpoint, **kwargs)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/transformers/modeling_utils.py", line 3539, in from_pretrained
dispatch_model(model, **device_map_kwargs)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/accelerate/big_modeling.py", line 494, in dispatch_model
model.to(device)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/transformers/modeling_utils.py", line 2271, in to
return super().to(*args, **kwargs)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 989, in to
return self._apply(convert)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 641, in _apply
module._apply(fn)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 641, in _apply
module._apply(fn)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 641, in _apply
module._apply(fn)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 664, in _apply
param_applied = fn(param)
File "/home/czh/.conda/envs/sam/lib/python3.8/site-packages/torch/nn/modules/module.py", line 987, 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!

###kwargs = {"device_map": "cpu", "torch_dtype": torch.bfloat16}

Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant