美文网首页
2018-10-04 Pytorch IndexError: t

2018-10-04 Pytorch IndexError: t

作者: 云雨惊袭明月夜 | 来源:发表于2018-10-04 16:25 被阅读0次

layout: post
title: IndexError: too many indices for array
subtitle: 一个由pytorch版本兼容性导致的问题
date: 2018-10-04
author: Johnny
header-img: img/post-bg-ios9-web.jpg
catalog: true
tags:
- iOS
- Demo


Pytorch 4.0 报错 IndexError: too many indices for array

出现问题的原因:pytorch 3.0 和 4.0以上版本不兼容,数据无法自动转换格式

action = action.data.numpy()[0].astype('int32')

改为

action = action.data.numpy()[0].astype('int32')

就可以了

相关文章

网友评论

      本文标题:2018-10-04 Pytorch IndexError: t

      本文链接:https://www.haomeiwen.com/subject/zavxaftx.html