torch_DCEC icon indicating copy to clipboard operation
torch_DCEC copied to clipboard

Question for the architecture

Open MJ1021 opened this issue 5 years ago • 0 comments

Hello. I'm a pretty newcomer to Pytorch. so my question may be a low-quality question. When I download and run your code under CAE_5 architecture, I got an error message as follow:

Traceback (most recent call last): File "torch_DCEC.py", line 347, in model = eval(to_eval) File "", line 1, in File "/home/xxx/python35/torch_DCEC/nets.py", line 362, in init self.embedding = nn.Linear(lin_features_len, num_clusters, bias=bias) File "/home/xxx/.local/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 81, in init self.reset_parameters() File "/home/xxx/.local/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 84, in reset_parameters init.kaiming_uniform(self.weight, a=math.sqrt(5)) File "/home/xxx/.local/lib/python3.6/site-packages/torch/nn/init.py", line 325, in kaiming_uniform_ std = gain / math.sqrt(fan) ZeroDivisionError: float division by zero_

Also, when I tried CAE_4 and CAE_bn4, I got error messages as follow: RuntimeError: The size of tensor a (20) must match the size of tensor b (28) at non-singleton dimension 3

Could you let me know how to fix it? Thank you in advance.

MJ1021 avatar Nov 15 '20 02:11 MJ1021