# Error with JsonReader.tf\_input\_ops()

**URL:** <https://discuss.ray.io/t/error-with-jsonreader-tf-input-ops/3846>\
**Category:** RLlib\
**Created:** [October 18, 2021, 5:25pm UTC](https://discuss.ray.io/t/error-with-jsonreader-tf-input-ops/3846 "2021-10-18T17:25:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wpwpxpxp](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/wpwpxpxp/32/1615_2.png) [@wpwpxpxp](https://discuss.ray.io/u/wpwpxpxp)\
**Post date:** [October 18, 2021, 5:25pm UTC](https://discuss.ray.io/t/error-with-jsonreader-tf-input-ops/3846/1 "2021-10-18T17:25:02Z")

</div>

When I run the following code (as instructed on the website [RLlib Offline Datasets — Ray v1.7.0](https://docs.ray.io/en/latest/rllib-offline.html)), 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  
self.\_queue\_runner.enqueue(batch)  
File “file\_path”, line 113, in enqueue  
self.sess.run(self.enqueue\_op, feed\_dict=data)  
AttributeError: ‘NoneType’ object has no attribute ‘run’

I checked with input\_reader.next(), it has data with it.

Does anyone know what the problem is? Thank.

---

<div class="post-metadata">

**Author:** ![Lars\_Simon\_Zehnder](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/lars_simon_zehnder/32/1185_2.png) [@Lars\_Simon\_Zehnder](https://discuss.ray.io/u/Lars_Simon_Zehnder)\
**Post date:** [October 27, 2021, 6:51pm UTC](https://discuss.ray.io/t/error-with-jsonreader-tf-input-ops/3846/2 "2021-10-27T18:51:48Z")

</div>

Hi @wpwpxpxp ,

to me that looks like there is no tensorflow session. It needs a tensorflow session in the [`_QueueRunner`](https://github.com/ray-project/ray/blob/aa5499ef0fc141f01db52df133a5b473d5f82fab/rllib/offline/input_reader.py#L94) to run the evaluate the tensors. Have you run [this example](https://github.com/ray-project/ray/blob/master/rllib/examples/custom_model_loss_and_metrics.py) by @sven1977 ? I would start there to get a grip on it.

Hope I could help here
