3

我正在开发一个使用 CARLA 模拟器来模拟自动驾驶汽车的项目。我在某处读到 keras 不能很好地处理线程,是真的吗?

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

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

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}}]]
4

0 回答 0