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

torch0.3 py=3.6 RuntimeError #12

Open
oneHuster opened this issue Dec 19, 2017 · 2 comments
Open

torch0.3 py=3.6 RuntimeError #12

oneHuster opened this issue Dec 19, 2017 · 2 comments

Comments

@oneHuster
Copy link

Traceback (most recent call last):
  File "train.py", line 365, in <module>
    pggan.train()
  File "train.py", line 286, in train
    self.train_phase(R, phase, batch_size, _range[0]*batch_size, _range[0], _range[1])
  File "train.py", line 240, in train_phase
    self.forward_D(cur_level, detach=True)
  File "train.py", line 196, in forward_D
    self.d_real = self.D(self.real, cur_level=cur_level, gdrop_strength=strength)
  File "/home/jurh/anaconda2/envs/th03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "models/model.py", line 218, in forward
    return self.output_layer(x, y, cur_level, insert_y_at)
  File "/home/jurh/anaconda2/envs/th03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "models/base_model.py", line 280, in forward
    x = self.chain[max_level](x)
  File "/home/jurh/anaconda2/envs/th03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/jurh/anaconda2/envs/th03/lib/python3.6/site-packages/torch/nn/modules/container.py", line 67, in forward
    input = module(input)
  File "/home/jurh/anaconda2/envs/th03/lib/python3.6/site-packages/torch/nn/modules/module.py", line 325, in __call__
    result = self.forward(*input, **kwargs)
  File "models/base_model.py", line 74, in forward
    vals = torch.mean(vals, keepdim=True)
RuntimeError: mean() missing 1 required positional arguments: "dim"
@yuanzhaoYZ
Copy link
Contributor

yuanzhaoYZ commented Dec 20, 2017

@oneHuster
you can fix that by changing line 74 in models/base_model.py to the following:

 vals = torch.mean(vals, dim=1, keepdim=True)

@oneHuster
Copy link
Author

thx

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