michaal94 / torch_DCEC

Pytorch Deep Clustering with Convolutional Autoencoders implementation
MIT License
98 stars 30 forks source link

Question for the architecture #9

Open MJ1021 opened 3 years ago

MJ1021 commented 3 years ago

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.kaiminguniform(self.weight, a=math.sqrt(5)) File "/home/xxx/.local/lib/python3.6/site-packages/torch/nn/init.py", line 325, in kaiminguniform 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.