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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

deepcopy of LazyLinear fails #83168

Open
nicolas-dufour opened this issue Aug 10, 2022 · 1 comment
Open

deepcopy of LazyLinear fails #83168

nicolas-dufour opened this issue Aug 10, 2022 · 1 comment
Labels
actionable module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@nicolas-dufour
Copy link

nicolas-dufour commented Aug 10, 2022

馃悰 Describe the bug

When running

l_linear = LazyLinear(10)
deepcopy(l_linear)

the following error is triggered

Exception has occurred: TypeError
empty() received an invalid combination of arguments - got (int, dtype=NoneType, device=bool), but expected one of:
 * (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of SymInts size, *, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
  File "/Users/ndufour/Documents/pytorch/rl/debug_deepcopy.py", line 9, in <module>
    deepcopy(l_linear)

This prevents making deepcopy of models before doing forward on one of them

Versions

Collecting environment information...
PyTorch version: 1.13.0.dev20220725
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.5 (arm64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: Could not collect
Libc version: N/A

Python version: 3.9.12 (main, Jun 1 2022, 06:34:44) [Clang 12.0.0 ] (64-bit runtime)
Python platform: macOS-12.5-arm64-arm-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] functorch==0.3.0a0+516a8cd
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.1
[pip3] torch==1.13.0.dev20220725
[pip3] torchrl==0.0.1a0+008bebd
[pip3] torchvision==0.14.0.dev20220725
[conda] functorch 0.3.0a0+516a8cd pypi_0 pypi
[conda] numpy 1.23.1 py39h42add53_0
[conda] numpy-base 1.23.1 py39hadd41eb_0
[conda] pytorch 1.13.0.dev20220725 py3.9_0 pytorch-nightly
[conda] torchrl 0.0.1a0+008bebd dev_0
[conda] torchvision 0.14.0.dev20220725 py39_cpu pytorch-nightly

cc @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are

@soulitzer soulitzer added module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Aug 11, 2022
@jbschlosser
Copy link
Contributor

Related: #65051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable module: nn Related to torch.nn triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

4 participants