- 博客(1)
- 收藏
- 关注
原创 AttributeError: ‘float‘ object has no attribute ‘astype‘
原始代码段: alpha = (np.random.uniform(-10, 30)).astype(np.float32) beta = (np.random.uniform(-10, 30)).astype(np.float32) 报错: AttributeError: ‘float’ object has no attribute ‘astype’原因: uniform没有指定size,得到的类型是一个number,而不是ndarray,所以不能用astype这样的方法。 解决方法: 指定size,例
2022-09-17 23:43:15
1622
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅