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
Traceback (most recent call last):
File "test_file.py", line 42, in
main(sys.argv[1:])
File "test_file.py", line 31, in main
word_segmenter = pick_lstm_model(model_name="Thai_codepoints_exclusive_model4_heavy",
File "/usr/local/google/home/ftang/lstm_word_segmentation/lstm_word_segmentation/word_segmenter.py", line 655, in pick_lstm_model
model = keras.models.load_model(file)
File "/usr/local/google/home/ftang/.local/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py", line 181, in load_model
isinstance(filepath, h5py.File) or h5py.is_hdf5(filepath))):
File "/usr/local/google/home/ftang/.local/lib/python3.8/site-packages/h5py/_hl/base.py", line 41, in is_hdf5
fname = os.path.abspath(fspath(fname))
TypeError: expected str, bytes or os.PathLike object, not PosixPath
Looks like we need to wrap the file with str()
The text was updated successfully, but these errors were encountered:
On my MacBook, this works with or without str. I think PosixPath is only compatible with Unix and some other platforms. If this is true then yes, we need that str around the file name. Are you running this code on Windows?
Test code
Traceback (most recent call last):
File "test_file.py", line 42, in
main(sys.argv[1:])
File "test_file.py", line 31, in main
word_segmenter = pick_lstm_model(model_name="Thai_codepoints_exclusive_model4_heavy",
File "/usr/local/google/home/ftang/lstm_word_segmentation/lstm_word_segmentation/word_segmenter.py", line 655, in pick_lstm_model
model = keras.models.load_model(file)
File "/usr/local/google/home/ftang/.local/lib/python3.8/site-packages/tensorflow/python/keras/saving/save.py", line 181, in load_model
isinstance(filepath, h5py.File) or h5py.is_hdf5(filepath))):
File "/usr/local/google/home/ftang/.local/lib/python3.8/site-packages/h5py/_hl/base.py", line 41, in is_hdf5
fname = os.path.abspath(fspath(fname))
TypeError: expected str, bytes or os.PathLike object, not PosixPath
Looks like we need to wrap the file with str()
The text was updated successfully, but these errors were encountered: