Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

ValueError: unrecognized program format #42

Open
Tony-Labor opened this issue Mar 21, 2019 · 3 comments
Open

ValueError: unrecognized program format #42

Tony-Labor opened this issue Mar 21, 2019 · 3 comments

Comments

@Tony-Labor
Copy link

In run_model.py, line 161, The type of ' predicted_program' is torch.Tensor.
However, in iep/module/module_net.py, the type of this parameter is restricted to list, tuple and Viarable (dim=2).
I tried to convert predicted_program form torch.Tensor to list or Variable, but failed.

@jcjohnson
Copy link
Contributor

This code was originally developed on an earlier version of PyTorch (0.3) that made a distinction between Tensor and Variable; these two types were merged in PyTorch 0.4. This repo will need some updating to run on PyTorch 1.0; as a quick fix you can try running it with PyTorch 0.3 instead.

@1245994042
Copy link

This code was originally developed on an earlier version of PyTorch (0.3) that made a distinction between Tensor and Variable; these two types were merged in PyTorch 0.4. This repo will need some updating to run on PyTorch 1.0; as a quick fix you can try running it with PyTorch 0.3 instead.

Hi,when i try pytorch 0.3,it will shows: AttributeError: module 'torch.nn.init' has no attribute 'kaiming_normal_'
Can you give me a hand?

@AishaAlaagib
Copy link

Please, I am getting problem with Reinforce() in seq2seq.py was removing is there any one have been facing this issues?
RuntimeError: reinforce() was removed.
Use torch.distributions instead.
See https://pytorch.org/docs/master/distributions.html
Instead of:
probs = policy_network(state)
action = probs.multinomial()
next_state, reward = env.step(action)
action.reinforce(reward)
action.backward()
Use:
probs = policy_network(state)

NOTE: categorical is equivalent to what used to be called multinomial

m = torch.distributions.Categorical(probs)
action = m.sample()
Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants