@cshallue
I was trying to run #466 on Python 3.5 and I was getting the following error:
Traceback (most recent call last):
File "test.py", line 84, in
tf.app.run()
File "/data/venvs/tensorflow/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 43, in run
sys.exit(main(sys.argv[:1] + flags_passthrough))
File "test.py", line 74, in main
captions = generator.beam_search(sess, image)
File "/media/scott/BigHD/Code/tensorflow_ex/im2txt/inference_utils/caption_generator.py", line 193, in beam_search
partial_captions.push(beam)
File "/media/scott/BigHD/Code/tensorflow_ex/im2txt/inference_utils/caption_generator.py", line 77, in push
heapq.heappush(self._data, x)
TypeError: unorderable types: Caption() < Caption()
The Caption class only implements __cmp__, but needs __lt__ and __eq__ for Python 3. It's a simple addition that would help compatibility between the versions. I'm not sure if you're planning on supporting Python 3, but everything else worked out of the box except this when I ran the run_inference.py file from the repo.
Hi @srome, I made #842 for this. Please check!
Thanks 馃槃
@tae-jun it looks good to me. I did a similar fix on my own local.
Most helpful comment
@tae-jun it looks good to me. I did a similar fix on my own local.