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

SystemError in test phase: <TypeError: a bytes-like object is required, not 'str'> #67

Open
baratialireza opened this issue Dec 1, 2019 · 2 comments

Comments

@baratialireza
Copy link

hi.
I was able to complete the training phase, but I encounter this error during the testing phase after evaluating the model. Can anyone help m
error.pdf
e?

loading annotations into memory...
Done (t=0.50s)
creating index...
index created!
Building the vocabulary...
Vocabulary built.
Number of words = 5000
Building the dataset...
Dataset built.
Building the CNN...
CNN built.
Building the RNN...
RNN built.
Loading the model from ./models/25999.npy...
100%|██████████| 47/47 [00:07<00:00, 2.77it/s]
47 tensors loaded.
Evaluating the model ...
batch: 100%|██████████| 1266/1266 [1:55:15<00:00, 5.39s/it]
Traceback (most recent call last):

File "", line 1, in
runfile('D:/programs/barati/image captioning/mscoco/image_captioning-DeepRNN/main.py', wdir='D:/programs/barati/image captioning/mscoco/image_captioning-DeepRNN')

File "C:\Users\SamRayaneh\Anaconda3\envs\tensorflow3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Users\SamRayaneh\Anaconda3\envs\tensorflow3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/programs/barati/image captioning/mscoco/image_captioning-DeepRNN/main.py", line 131, in
tf.app.run()

File "C:\Users\SamRayaneh\Anaconda3\envs\tensorflow3\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))

File "D:/programs/barati/image captioning/mscoco/image_captioning-DeepRNN/main.py", line 120, in main
model.eval(sess, coco, data, vocabulary)

File "D:\programs\barati\image captioning\mscoco\image_captioning-DeepRNN\base_model.py", line 102, in eval
json.dump(results, fp)

File "C:\Users\SamRayaneh\Anaconda3\envs\tensorflow3\lib\json_init_.py", line 180, in dump
fp.write(chunk)

TypeError: a bytes-like object is required, not 'str'

@lihb666
Copy link

lihb666 commented Nov 17, 2020

hi.
I meet the error as yours.Have you debugged it?

@baratialireza
Copy link
Author

baratialireza commented Nov 19, 2020 via email

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

2 participants