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

TypeError: __init__() got an unexpected keyword argument 'reduction' #7

Closed
Coderx7 opened this issue Aug 29, 2018 · 6 comments
Closed

Comments

@Coderx7
Copy link

Coderx7 commented Aug 29, 2018

Hi,
When I try to run the script, I face this error , whats wrong ?
TypeError: __init__() got an unexpected keyword argument 'reduction'
I'm calling the script like this :

IMAGENET_DIR=ImageNet_DataSet
MODEL_NAME=mobilenet
python main.py --dataset $IMAGENET_DIR --model $MODEL_NAME 

I'm using Python3.6 and Pytorch 0.4
Thanks alot in advance

@eladhoffer
Copy link
Owner

make sure you have updated utils.pytorch (git pull) and latest pytorch (>0.4.1)

@Coderx7
Copy link
Author

Coderx7 commented Oct 24, 2018

As a side question, did you usea single gpu with batch of 256? or multiple gpus? if so how many?

@asgq123
Copy link

asgq123 commented Dec 20, 2018

@Coderx7 Hello,did you solve your problem with upgrade pytorch version

@Coderx7
Copy link
Author

Coderx7 commented Dec 20, 2018

@qiyayun : I never upgraded to 0.4.1 so I have no idea if that solves the issue. I simply never used the script when I got that error.
updating to 0.4.1 is a safe bet however since 0.4.1 doesnt have any breaking changes if you are already on 0.4!)

@blueardour
Copy link

My torch version is 0.4.1.

import torch
torch.version
'0.4.1'

In my experiment, I didn't meet the reduction problem. However, I got 'named_parameters() got an unexpected keyword argument 'recurse' for line 26th in utils.pytorch/param_filter.py.

I checked the tutorial in pytorch website https://pytorch.org/docs/stable/nn.html , it showed 'recurse' was indeed available. It's strange why give such error.

@blueardour
Copy link

After a check, the 'recurse' doesn't exist in the pytorch 0.4.1 version.
def named_parameters(self, memo=None, prefix=''): cited from https://github.com/pytorch/pytorch/blob/v0.4.1/torch/nn/modules/module.py

and it does in the v1.0 version.

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

4 participants