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
出現(xiàn)問題的原因:pytorch 3.0 和 4.0以上版本不兼容,數(shù)據(jù)無法自動轉(zhuǎn)換格式
action = action.data.numpy()[0].astype('int32')
改為
action = action.data.numpy()[0].astype('int32')
就可以了