Error with JsonReader.tf_input_ops()

When I run the following code (as instructed on the website RLlib Offline Datasets — Ray v1.7.0), I got the errors.

input_reader = JsonReader("/tmp/cartpole-out")
input_ops = input_reader.tf_input_ops()
print(input_ops[“obs”]) # → output Tensor shape=[None, 4]
print(input_ops[“actions”]) # → output Tensor shape=[None]

Traceback (most recent call last):
File “file_path”, line 13, in
input_ops = input_reader.tf_input_ops()
File “file_path”, line 87, in tf_input_ops
File “file_path”, line 113, in enqueue, feed_dict=data)
AttributeError: ‘NoneType’ object has no attribute ‘run’

I checked with, it has data with it.

Does anyone know what the problem is? Thank.

Hi @wpwpxpxp ,

to me that looks like there is no tensorflow session. It needs a tensorflow session in the _QueueRunner to run the evaluate the tensors. Have you run this example by @sven1977 ? I would start there to get a grip on it.

Hope I could help here