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

torch.package: TypeError: 'NoneType' object is not iterable #60089

Open
tchaton opened this issue Jun 16, 2021 · 4 comments
Open

torch.package: TypeError: 'NoneType' object is not iterable #60089

tchaton opened this issue Jun 16, 2021 · 4 comments
Labels
imported This issue has been imported to the internal tasks tool oncall: package/deploy Add issue/PR to torch.package TODO board

Comments

@tchaton
Copy link

tchaton commented Jun 16, 2021

馃悰 Bug

To Reproduce

This happens with pytorch_lightning.loggers.base.DummyExperiment which can be found at:
https://github.com/PyTorchLightning/pytorch-lightning/blob/9097347ea8e354c5bed1aec186be305c1216bc81/pytorch_lightning/loggers/base.py#L429

Traceback (most recent call last):
  File "tabular_classification.py", line 49, in <module>
    model.to_package('tabular_package.zip', verbose=True)
  File "/Users/thomas/Documents/GitHub/lightning-flash/flash/core/model.py", line 652, in to_package
    exporter.save_pickle('models', 'model.pkl', self)
  File "/Users/thomas/Documents/GitHub/lightning-flash/.venv/lib/python3.7/site-packages/torch/package/package_exporter.py", line 497, in save_pickle
    pickler.dump(obj)
  File "/Users/thomas/Documents/GitHub/lightning-flash/.venv/lib/python3.7/site-packages/torch/package/package_exporter.py", line 737, in _persistent_id
    if self.serialized_reduces.get(id(obj)) is None:
TypeError: 'NoneType' object is not iterable

Steps to reproduce the behavior:

Expected behavior

Environment

Please copy and paste the output from our
environment collection script
(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
  • PyTorch Version (e.g., 1.0):
  • OS (e.g., Linux):
  • How you installed PyTorch (conda, pip, source):
  • Build command you used (if compiling from source):
  • Python version:
  • CUDA/cuDNN version:
  • GPU models and configuration:
  • Any other relevant information:

Additional context

cc @gmagogsfm

@anjali411 anjali411 added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jun 16, 2021
@github-actions github-actions bot added this to Need triage in JIT Triage Jun 16, 2021
@nikithamalgifb
Copy link
Contributor

@Lilyjjo @SplitInfinity @suo : Do you guys have any idea about this?

@nikithamalgifb nikithamalgifb moved this from Need triage to In discussion in JIT Triage Jun 16, 2021
@Lilyjjo
Copy link
Contributor

Lilyjjo commented Jun 16, 2021

Hi @tchaton, are you able to provide the code you are using to package the DummyExperiment as well? I'm able to package the DummyExperiment class without that error

@Lilyjjo Lilyjjo added this to To do in torch.package via automation Jun 16, 2021
@Lilyjjo Lilyjjo removed this from In discussion in JIT Triage Jun 16, 2021
@Lilyjjo Lilyjjo added oncall: package/deploy Add issue/PR to torch.package TODO board and removed oncall: jit Add this issue/PR to JIT oncall triage queue labels Jun 16, 2021
@tchaton
Copy link
Author

tchaton commented Jun 16, 2021

Hey @Lilyjjo,

Here is the associated PR in Lightning Flash: https://github.com/PyTorchLightning/lightning-flash/pull/416/files

How to reproduce:

Best
T.C

@Lilyjjo
Copy link
Contributor

Lilyjjo commented Jun 16, 2021

Hi @tchaton, are you able to create a smaller minimal repro? That would help me help you faster!

@Lilyjjo Lilyjjo self-assigned this Jun 16, 2021
@Lilyjjo Lilyjjo moved this from To do to In progress in torch.package Jun 16, 2021
@facebook-github-bot facebook-github-bot added the imported This issue has been imported to the internal tasks tool label Aug 20, 2021
@Lilyjjo Lilyjjo removed their assignment Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
imported This issue has been imported to the internal tasks tool oncall: package/deploy Add issue/PR to torch.package TODO board
Projects
torch.package
In progress
Development

No branches or pull requests

5 participants