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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: type object 'Variable' has no attribute 'chunk' #7

Closed
MrLinNing opened this issue Oct 20, 2018 · 2 comments
Closed
Assignees

Comments

@MrLinNing
Copy link

hello, @tbung
My Pytorch version is 0.4.0, cuda version is 9.0 and python is 3.5.
But when I run this command:

python train_cifar.py --model revnet38 --clip 0.25

Problem happened:


File "pytorch-revnet/revnet/revnet.py", line 191, in _grad 
        dy1, dy2 = Variable.chunk(dy, 2, dim=1) 
AttributeError: type object 'Variable' has no attribute 'chunk'

Can you help me to fix the bug? Thank you.

@tbung tbung self-assigned this Oct 21, 2018
@tbung
Copy link
Owner

tbung commented Oct 24, 2018

Hi @MrLinNing,

this bug is due to the fact that this code was written when pytorch 0.4 was not released yet, and a bunch of stuff changed since then, as described in the migration guide.

I will try and fix all related issues, but I currently have other stuff I need to work on, so it might take some time.

You can of course try and fix all related issues by yourself, your bug should be resolved by replacing Variable.chunk with torch.chunk. Pull requests are very welcome if you do!

Thanks for your interest and patience!

Cheers,
Till

@tbung
Copy link
Owner

tbung commented Dec 19, 2018

This has been closed by @JuanFMontesinos in #8.

@tbung tbung closed this as completed Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants