Skip to content

UserWarning: 'layers' was found in ScriptModule constants #1721

@lutzroeder

Description

@lutzroeder

🐛 Bug

Creating torchvision.models.densenet161 shows UserWarning.

To Reproduce

pip3 install --pre torch torchvision -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
import pydoc
import torch
model = pydoc.locate('torchvision.models.densenet161')(pretrained=True)
script = torch.jit.script(model)
usr/local/lib/python3.7/site-packages/torch/jit/_recursive.py:145: UserWarning: 'layers' was found in ScriptModule constants, but was not actually set in __init__. Consider removing it.
  "Consider removing it.".format(name))

Environment

Collecting environment information...
PyTorch version: 1.4.0
Is debug build: No
CUDA used to build PyTorch: None

OS: Mac OSX 10.15.2
GCC version: Could not collect
CMake version: version 3.15.3

Python version: 3.7
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] torch==1.4.0
[pip3] torchvision==0.5.0.dev20200105
[conda] Could not collect

@eellison

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions