gin-config
gin-config copied to clipboard
TypeError: 'zip' object is not subscriptable
This is the error summary
---> 32 import gin.tf 33 import numpy as np 34 import replay_memory
~/anaconda3/lib/python3.6/site-packages/gin/tf/init.py in
~/anaconda3/lib/python3.6/site-packages/gin/tf/utils.py in
~/anaconda3/lib/python3.6/site-packages/gin/config.py in register_file_reader(*args) 1412 return functools.partial(do_registration, is_readable_fn=args[0]) 1413 elif len(args) == 2: -> 1414 do_registration(*args) 1415 else: # 0 or > 2 arguments supplied. 1416 err_str = 'register_file_reader() takes 1 or 2 arguments ({} given)'
~/anaconda3/lib/python3.6/site-packages/gin/config.py in do_registration(file_reader_fn, is_readable_fn) 1406 """ 1407 def do_registration(file_reader_fn, is_readable_fn): -> 1408 if file_reader_fn not in list(zip(*_FILE_READERS))[0]: 1409 _FILE_READERS.append((file_reader_fn, is_readable_fn)) 1410
TypeError: 'zip' object is not subscriptable
1
How do I fix this?
Can anyone help me with this error?
Can you make sure that your TF version has tf.gfile.Open, tf.gfile.Exists?
I have this same issue, and my TF version has tf.gfile.Open, tf.gfile.Exists
It is probably related to using Python3 instead of 2 (see https://stackoverflow.com/questions/27431390/typeerror-zip-object-is-not-subscriptable ).
Cast the zip
object into a list like list(zip(*_FILE_READERS))[0]
@homaralex
Your reply truely helps.