Tensorflow.python Framework FailedPreconditionError:从容器中读取资源变量时出错:本地主机

时间:2019-11-14 13:36:40

标签: python tensorflow keras reinforcement-learning carla

我正在研究一个使用CARLA模拟器模拟自动驾驶汽车的项目。我在某个地方读到keras无法很好地处理线程,对吗?

此外,在使用Tensorflow运行训练脚本时,我们创建了多个线程进行强化学习。但是,我们收到以下错误。可能是什么原因?

(P.S。我已经尝试过调整会话变量以提供更多的内存。)

Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "D:\SDC\Carla-RL-master\sources\trainer.py", line 223, in train_in_loop
    if not self.train():
  File "D:\SDC\Carla-RL-master\sources\trainer.py", line 110, in train
    current_qs_list = self.model.predict(current_states, settings.PREDICTION_BATCH_SIZE)
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\site-packages\keras\engine\training.py", line 1462, in predict
    callbacks=callbacks)
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\site-packages\keras\engine\training_arrays.py", line 324, in predict_loop
    batch_outs = f(ins_batch)
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\site-packages\tensorflow\python\keras\backend.py", line 3076, in __call__
    run_metadata=self.run_metadata)
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\site-packages\tensorflow\python\client\session.py", line 1439, in __call__
    run_metadata_ptr)
  File "C:\Users\Ankit\Anaconda\envs\navigate\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 528, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable conv2d_3/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/conv2d_3/kernel)
         [[{{node conv2d_3/convolution/ReadVariableOp}}]]
         [[{{node dense_2/BiasAdd}}]]

0 个答案:

没有答案