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

I want to test your code, but something went wrong in train.py #3

Open
nightsky37 opened this issue Dec 27, 2021 · 5 comments
Open

Comments

@nightsky37
Copy link

Traceback (most recent call last):
  File "train.py", line 27, in <module>
    w = open('./logs/merge_tes_40attn.log', 'w')
FileNotFoundError: [Errno 2] No such file or directory: './logs/merge_tes_40attn.log'

It seems no file named "logs". Could you provide it? Thank you.

@chmxu
Copy link
Owner

chmxu commented Feb 16, 2022

You can simply create a 'logs' directory. I think this will work.

@xiaolongtuan-yuan
Copy link

when I run train.py
i got this error:

ModuleNotFoundError: No module named 'torch.nn._functions'

and i didn't find this module in pytorch's ducument

@chmxu
Copy link
Owner

chmxu commented Sep 30, 2022

when I run train.py i got this error:

ModuleNotFoundError: No module named 'torch.nn._functions'

and i didn't find this module in pytorch's ducument

Hi, can you provide an error log? I guess there is something wrong with your installation of pytorch or the version of that.

@xiaolongtuan-yuan
Copy link

when I run train.py i got this error:
ModuleNotFoundError: No module named 'torch.nn._functions'
and i didn't find this module in pytorch's ducument

Hi, can you provide an error log? I guess there is something wrong with your installation of pytorch or the version of that.

Traceback (most recent call last):
File "train.py", line 2, in
from model import Scoring
File "/content/drive/MyDrive/MS_LSTM/model.py", line 7, in
from util.graph_definition import *
File "/content/drive/MyDrive/MS_LSTM/util/graph_definition.py", line 13, in
from rnn_cells.base_rnn import custom_LSTM
File "/content/drive/MyDrive/MS_LSTM/rnn_cells/base_rnn.py", line 8, in
from rnn_cells.functions_rnn import custom_RNN as backend_custom_RNN
File "/content/drive/MyDrive/MS_LSTM/rnn_cells/functions_rnn.py", line 4, in
from torch.nn._functions.rnn import LSTMCell, GRUCell
ModuleNotFoundError: No module named 'torch.nn._functions'

@chmxu
Copy link
Owner

chmxu commented Sep 30, 2022

I have checked that pytorch 0.4.0 has this module but the latest version has changed that. I think changing your version to 0.4.0/updating the code according to your version (e.g. find the corresponding LSTMCell module in the latest version) can work this problem out.

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

3 participants