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

Deprecated modules #6

Open
nshervt opened this issue Nov 20, 2019 · 4 comments
Open

Deprecated modules #6

nshervt opened this issue Nov 20, 2019 · 4 comments

Comments

@nshervt
Copy link

nshervt commented Nov 20, 2019

I tried using kymatio with this code. If you were interested in updating it, I switched the scattering method to kymatio but there are more things to be fixed, for instance, in STL, it seems that torch.legacy that you are using in utils has been deprecated and needs to be changed. In imagenet test, line torch.randn(8).cuda() again uses cuda, and when I comment .cuda() out, I fall into a rabbit hole of errors. the latest being

Traceback (most recent call last):
  File "/Users/Nshervt/Desktop/scalingscattering-master/imagenet/main_test.py", line 186, in <module>
    main()
  File "/Users/Nshervt/Desktop/scalingscattering-master/imagenet/main_test.py", line 65, in main
    model, params, stats = models.__dict__[opt.model](N=opt.N,J=opt.scat)
  File "/Users/Nshervt/Desktop/scalingscattering-master/imagenet/models/scatter_resnet.py", line 151, in scatresnet6_2
    model = ScatResNet(J,N)
  File "/Users/Nshervt/Desktop/scalingscattering-master/imagenet/models/scatter_resnet.py", line 61, in __init__
    self.bn0 = nn.BatchNorm2d(3*self.nfscat,eps=1e-5, momentum=0.9, affine=False)
  File "/Users/Nshervt/anaconda3/lib/python3.7/site-packages/torch/nn/modules/batchnorm.py", line 34, in __init__
    self.register_buffer('running_mean', torch.zeros(num_features))
TypeError: zeros(): argument 'size' (position 1) must be tuple of ints, not float
@edouardoyallon
Copy link
Owner

Here, the issue is easy, simply replace 3*self.nfscat by 3*int(self.nfscat)

Furthermore, the STL script is broken because we used old-school scripts (engine, opencv..)... I'm not really happy that this work isn't reproducible with the new version of torch, thus I'd be happy to help to reimplment it!

@nshervt
Copy link
Author

nshervt commented Nov 20, 2019

That would be great, Thanks! There are still errors in imagenet, I'll do a PR when I got it to work, or let you know if there were issues that I couldn't solve.

@eugenium
Copy link
Collaborator

eugenium commented Nov 20, 2019

btw for imagenet (esp if one is interested to train the models) this repo might also be useful and was done with newer versions of pytorch: https://github.com/edouardoyallon/pyscatlight. Its using only 1st order though but that can be easily adapted

@nshervt
Copy link
Author

nshervt commented Nov 20, 2019

Thanks @eugenium , I just tried running this, but this is also written for pytorch0.4 and doesn't work with newer versions. I opened an issue with specific problem if you were interested.

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

3 participants