You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/home/jgmeyer2/anaconda3/envs/vangan/lib/python3.6/site-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
Traceback (most recent call last):
File "gen_latent.py", line 41, in
model = JTNNVAE(vocab, hidden_size, latent_size, depth)
File "/home/jgmeyer2/icml18-jtnn/jtnn/jtnn_vae.py", line 40, in init
self.T_mean = nn.Linear(hidden_size, latent_size / 2)
File "/home/jgmeyer2/anaconda3/envs/vangan/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 41, in init
self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (float, int), but expected one of:
(torch.device device)
(torch.Storage storage)
(Tensor other)
(tuple of ints size, torch.device device)
didn't match because some of the arguments have invalid types: (float, int)
(object data, torch.device device)
didn't match because some of the arguments have invalid types: (float, int)
It seems that torch doesn't like the way the the nn.Linear is initialized?
The text was updated successfully, but these errors were encountered:
Thanks for your help. I did try setting the value with int() as you
describe, and I even tried putting it values directly into the jtvaenn
class, but it throws the same error. It's strange because my other networks
in pytorch take integers fine, but the difference is the my other networks
define the network after the "super" under a different class function.
I think it might have to do with where the network layers are defined, and
probably that this network was written with torch version older than 0.4.1?
OK, actually setting that as int() as you describe does work.
I was confused because even though I changed jtnn_vae.py, saved it, and re-imported it into my jupyter notebook, it did not change the kernel's definition of JTVAENN()
I realized this because it would print the same error that it was getting (int, float) and even point to the same line even though I had moved the line, commented it out, or deleted the line.
I'm using python 3.6 with torch 0.4.1 and I'm trying to use your model to map molecules into latent space, but when I run this:
python gen_latent.py --data ../LINCS/cp_trt.smi --vocab data/vocab.txt --hidden 450 --depth 3 --latent 56 --model molvae/MPNVAE-h450-L56-d3-beta0.005/model.iter-4
I get the following out:
/home/jgmeyer2/anaconda3/envs/vangan/lib/python3.6/site-packages/torch/nn/functional.py:52: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
Traceback (most recent call last):
File "gen_latent.py", line 41, in
model = JTNNVAE(vocab, hidden_size, latent_size, depth)
File "/home/jgmeyer2/icml18-jtnn/jtnn/jtnn_vae.py", line 40, in init
self.T_mean = nn.Linear(hidden_size, latent_size / 2)
File "/home/jgmeyer2/anaconda3/envs/vangan/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 41, in init
self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (float, int), but expected one of:
didn't match because some of the arguments have invalid types: (float, int)
didn't match because some of the arguments have invalid types: (float, int)
It seems that torch doesn't like the way the the nn.Linear is initialized?
The text was updated successfully, but these errors were encountered: