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

nb_layers should be int #9

Open
bmitzkus opened this issue Dec 2, 2019 · 1 comment
Open

nb_layers should be int #9

bmitzkus opened this issue Dec 2, 2019 · 1 comment

Comments

@bmitzkus
Copy link

bmitzkus commented Dec 2, 2019

When executing python train.py --dataset svhn --model wideresnet --learning_rate 0.01 --epochs 160 --cutout --length 20 I get the following error:

Traceback (most recent call last):
  File "train.py", line 149, in <module>
    dropRate=0.4)
  File "Cutout/model/wide_resnet.py", line 58, in __init__
    self.block1 = NetworkBlock(n, nChannels[0], nChannels[1], block, 1, dropRate)
  File "Cutout/model/wide_resnet.py", line 38, in __init__
    self.layer = self._make_layer(block, in_planes, out_planes, nb_layers, stride, dropRate)
  File "Cutout/model/wide_resnet.py", line 41, in _make_layer
    for i in range(nb_layers):
TypeError: 'float' object cannot be interpreted as an integer

This error stems from the division here. For Python3.x, integer division must be forced like this: n = (depth - 4) // 6

@MotiBaadror
Copy link

MotiBaadror commented Aug 20, 2021

changing below line would remove the error
for i in range(nb_layers): ==> for i in range(int(nb_layers)):

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