Skip to content

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

@baratialireza

Description

@baratialireza

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions