Giter Site home page Giter Site logo

Comments (4)

kbbernander avatar kbbernander commented on May 28, 2024 3

Thanks for your answer and support. I tried updating PIL from 5.4.1 to 7.0.0, and executing the code inside a virtual environment but still the same problem occurs.

Here are the package version (Python 3.7 is used)

(e2cnn_2) karl@IT-LL-karbe297:~$ pip list
Package Version


attrs 19.3.0
backcall 0.1.0
bleach 3.1.0
decorator 4.4.1
defusedxml 0.6.0
e2cnn 0.1
entrypoints 0.3
importlib-metadata 1.4.0
ipykernel 5.1.3
ipython 7.11.1
ipython-genutils 0.2.0
jedi 0.15.2
Jinja2 2.10.3
json5 0.8.5
jsonschema 3.2.0
jupyter-client 5.3.4
jupyter-core 4.6.1
jupyterlab 1.2.5
jupyterlab-server 1.0.6
MarkupSafe 1.1.1
mistune 0.8.4
more-itertools 8.1.0
nbconvert 5.6.1
nbformat 5.0.3
notebook 6.0.2
numpy 1.18.1
pandocfilters 1.4.2
parso 0.5.2
pexpect 4.7.0
pickleshare 0.7.5
Pillow 7.0.0
pip 20.0.1
pkg-resources 0.0.0
prometheus-client 0.7.1
prompt-toolkit 3.0.2
ptyprocess 0.6.0
Pygments 2.5.2
pyrsistent 0.15.7
python-dateutil 2.8.1
pyzmq 18.1.1
scipy 1.4.1
Send2Trash 1.5.0
setuptools 45.1.0
six 1.14.0
terminado 0.8.3
testpath 0.4.4
torch 1.4.0
torchvision 0.5.0
tornado 6.0.3
traitlets 4.3.3
wcwidth 0.1.8
webencodings 0.5.1
wheel 0.33.6
zipp 2.0.0

from e2cnn.

Gabri95 avatar Gabri95 commented on May 28, 2024 1

Hi @Tarnekar! I am happy you liked our work!

Unfortunately, I have never had this problem.
It seems its source is in Pytorch's code where PIL functionalities are used.
Is it possible that you have an old version of PIL which is not fully compatible with your current version of torchvision?

Could you give some more details about your Python environment?

from e2cnn.

kbbernander avatar kbbernander commented on May 28, 2024 1

That was indeed the problem; using torch 1.3, torchvision 0.4 and pillow 6.2.1 and all the code runs. Although there is a warning that torchvision 0.4.0 has a requirement of torch==1.2.0.

Thanks!

from e2cnn.

Gabri95 avatar Gabri95 commented on May 28, 2024

I was indeed able to reproduce your problem.
Using torch 1.3 and torchvision 0.4 (and pillow 6.2.1), the following code runs.
However, I get your error when I update to the newest (recently released) versions of torch (1.4) and torchvision (0.5).

import torch
from torch.utils.data import DataLoader
from torchvision.transforms import RandomRotation
from torchvision.transforms import ToTensor
from torchvision.transforms import Compose
from torchvision.datasets import MNIST
from PIL import Image


transform = Compose([
    RandomRotation(180., resample=Image.BILINEAR, expand=False),
    ToTensor(),
])

mnist = MNIST("./", train=True, transform=transform, download=True)
train_loader = DataLoader(mnist, batch_size=1)


for x, t in enumerate(train_loader):
    print("hello world")
    break

For this reason, I think this is a problem with the new version of Pytorch.
I would suggest you to temporarily downgrade it to 1.3 if you want to use transforms.RandomRotation.
You can probably find more support on Pytorch's forum.

Hope this helps!

from e2cnn.

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.