[英]'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'squeeze'
Im an trying to use huskarl and load the demo files to tesnt that I have installed everything correctly.我正在尝试使用 huskarl 并将演示文件加载到测试我已正确安装所有内容。 However when I run any of the demo files I am met with this Trace:
但是,当我运行任何演示文件时,我遇到了以下跟踪:
Traceback (most recent call last):
File "ddpg-pendulum.py", line 48, in <module>
sim.train(max_steps=30_000, visualize=True, plot=plot_rewards)
File "C:\Users\Project Apollo\AppData\Local\Programs\Python\Python37\lib\site-packages\huskarl\simulation.py", line 32, in train
self._sp_train(max_steps, instances, visualize, plot)
File "C:\Users\Project Apollo\AppData\Local\Programs\Python\Python37\lib\site-packages\huskarl\simulation.py", line 66, in _sp_train
self.agent.train(step)
File "C:\Users\Project Apollo\AppData\Local\Programs\Python\Python37\lib\site-packages\huskarl\agent\ddpg.py", line 101, in train
target_qvals[non_final_mask] = self.target_critic.predict_on_batch([target_actions, np.array(non_final_last_next_states)]).squeeze()
AttributeError: 'tensorflow.python.framework.ops.EagerTensor' object has no attribute 'squeeze'
Any Idea what has gne wrong?知道有什么问题吗?
Error is in squeeze function used at the end错误是在最后使用的挤压函数中
self.target_critic.predict_on_batch([target_actions, np.array(non_final_last_next_states)]).squeeze() self.target_critic.predict_on_batch([target_actions, np.array(non_final_last_next_states)]).squeeze()
Try to use tf.squeeze()
or np.squeeze()
尝试使用
tf.squeeze()
或np.squeeze()
So I figured out that huskarl is only compatible with tensorflow==2.0.0a0.所以我发现 huskarl 只与 tensorflow==2.0.0a0 兼容。 I found that out by uninstall tf and reinstalling it and catching an error.
我通过卸载 tf 并重新安装它并捕获错误发现了这一点。 :/
:/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.