Skip to content

Update rnnrbm.py #201

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

Merged
merged 1 commit into from
Jan 26, 2018
Merged

Update rnnrbm.py #201

merged 1 commit into from
Jan 26, 2018

Conversation

LeoMingo
Copy link
Contributor

Hi, so I ran into this error at line 244, then I traced back the error it was due to at line 291, os.path.dirname(file) returned empty string and caused the split-out parent directory to be empty, thus the path argument passed into train() function became ./data/Nottingham/train/.mid which did not exist rather than ../data/Nottingham/train/ which was expected.
So I changed os.path.dirname(file) into os.path.dirname(os.path.abspath(file)) to get the current working directory from file's absolute path, by which you could then split out the parent directory.
You can refer the reason to this link: https://stackoverflow.com/questions/7783308/os-path-dirname-file-returns-empty

Hi, so I ran into this error at line 244, then I traced back the error it was due to at line 291, os.path.dirname(__file__) returned empty string and caused the split-out parent directory to be empty, thus the path argument passed into train() function became ./data/Nottingham/train/*.mid which did not exist rather than ../data/Nottingham/train/* which was expected.
So I changed os.path.dirname(__file__) into os.path.dirname(os.path.abspath(__file__)) to get the current working directory from file's absolute path, by which you could then split out the parent directory.
You can refer the reason to this link: https://stackoverflow.com/questions/7783308/os-path-dirname-file-returns-empty
@lamblin lamblin merged commit 238a0bc into lisa-lab:master Jan 26, 2018
@lamblin
Copy link
Member

lamblin commented Jan 26, 2018

Thanks!

@LeoMingo LeoMingo deleted the patch-3 branch January 26, 2018 05:00
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

Successfully merging this pull request may close these issues.

2 participants