无法转换numpy.object_类型的np.ndarray。唯一受支持的类型为:double,float,float16,int64,int32和uint8

时间:2020-07-23 12:14:53

标签: python arrays numpy torch

我正在尝试将一个numpy数组转换为割炬张量,但是我仍然遇到此错误。 “ TypeError:无法转换numpy.object_类型的np.ndarray。仅支持的类型为:double,float,float16,int64,int32和uint8。”

我尝试将本地numpy数组转换为火炬张量...它可以工作,但是在以下代码中它不起作用。 我检查了值中还没有NaN。

请在附件中找到我要转换的代码和变量。

batch_states,batch_next_states,batch_actions,batch_rewards,batch_dones = replay_buffer.sample(batch_size)

我有一个重播缓冲区,并从中获取随机的一批数据作为numpy.ndarray,并希望通过以下代码将其转换为torch.tensor

Counter({(1, 2): 2, (1, 1): 1, (2, 2): 1})

及以下输出

java.lang.IllegalArgumentException: Top hits result window is too large, the top hits aggregator [top]'s from + size must be less than or equal to: [100] but was [999]. This limit can be set by changing the [index.max_inner_result_window] index level setting.

有人可以帮助指导并让我知道我哪里错了

0 个答案:

没有答案