Coder Social home page Coder Social logo

Comments (8)

rbhernandez avatar rbhernandez commented on June 7, 2024 24

I did pip install --upgrade torch torchvision and it works

from lightning-bolts.

devdastl avatar devdastl commented on June 7, 2024 8

@Wheest
Since I was using colab, I found out it was more difficult to downgrade So I just changed that line in source code with string_classes = str in /usr/local/lib/python3.9/dist-packages/pl_bolts/datamodules/async_dataloader.py

@Borda is this the correct solution? Should we replace from torch._six import string_classes with string_classes = str

from lightning-bolts.

rehammsalah avatar rehammsalah commented on June 7, 2024

I'm facing the same issue, did you find any solution?

from lightning-bolts.

devdastl avatar devdastl commented on June 7, 2024

Thanks @rbhernandez that solved while import from pl_bolts.models but while importing pl_bolts.datamodules I am again getting torch.six error

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-19-fbbe43d17848>](https://localhost:8080/#) in <cell line: 1>()
----> 1 from pl_bolts.datamodules import CIFAR10DataModule
      2 
      3 datamodule = CIFAR10DataModule('.')

7 frames
[/usr/local/lib/python3.9/dist-packages/pl_bolts/datamodules/async_dataloader.py](https://localhost:8080/#) in <module>
      7 import torch
      8 from torch import Tensor
----> 9 from torch._six import string_classes
     10 from torch.utils.data import DataLoader, Dataset
     11 

ModuleNotFoundError: No module named 'torch._six'

---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.

To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------

from lightning-bolts.

rbhernandez avatar rbhernandez commented on June 7, 2024

@devdastl you can try upgrade lighting_bolts. Torch2.0 is now stable, and it must be most users choice now.
If you want compatible with older torch, just make a judgement on version to import.

Originally posted by @lucasjinreal in #992 (comment)

from lightning-bolts.

devdastl avatar devdastl commented on June 7, 2024

@rbhernandez thanks for the input. Do you know which version of pl_bolts work for 2.0.0+cu118?
Thanks again for the help!

from lightning-bolts.

Wheest avatar Wheest commented on June 7, 2024

I'm also experiencing this issue with PyTorch 2.0.0+cu118, with pl_bolts version 0.6.0.post1. I had to downgrade to torch==1.13.0.

from lightning-bolts.

lucasjinreal avatar lucasjinreal commented on June 7, 2024

@rbhernandez Please upgrade lighting_bolts rather than ask user to downgrading torch,

  1. torch2.0 is now stable, and it must be most users choice now, please upgrade to it;
  2. if you want compatible with older torch, just make a judgement on version to import

from lightning-bolts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.