-
Notifications
You must be signed in to change notification settings - Fork 703
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
Populate with Python 3.6: "TypeError: expected bytes, str found" #1187
Comments
It seems that removing the |
Ahh, yes, this is a common problem. Would you mind sending a pull request fixing the problem quickly? @xunzhang I'm not sure why our unit tests didn't catch this though. Perhaps we need to add an IO unit test to Python? |
Sure, but I haven't tested it on python 2... I guess it should be fine assuming that |
I added some tests in the above pull request. But I don't have a python3 environment, @vered1986 could you help test it? |
Sure, what should I run? (I guess this? https://github.com/clab/dynet/pull/1189/files) |
Yes, https://raw.githubusercontent.com/xunzhang/dynet/5b6cf0e0b5f76ab534943067676ab927c4ca6107/tests/python/test.py . You should get an error with current master and pass it with the modification of your pull request. |
Yes, works as expected. Output for master:
Output for pull request:
|
looks good |
Fixed via #1188. |
Hi,
I'm trying to load parameters of a model using populate:
where
w
is a parameter andload_from
is the file path string.I get the following exception:
I saved the parameters using the following code:
where
save_to
is the same string asload_from
.I work with python 3.6 and I suspect that the exception stems from the difference between strings in python 2 and 3: http://docs.cython.org/en/latest/src/tutorial/strings.html.
Thanks!
The text was updated successfully, but these errors were encountered: