编程问题汇总一(ACMR)

1、UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 17: ordinal not in range(128)

https://blog.csdn.net/qq_41185868/article/details/79039604

training_data, validation_data, test_data = cPickle.load(f)

改为即可,training_data, validation_data, test_data = cPickle.load(f,encoding='bytes')

2、ValueError: num_outputs type should be one of [<class 'int'>], got <class 'float'>.

float强制转化成int

3、TypeError: 'float' object cannot be interpreted as an integer

在python2,/只留下了整数部分,去掉了小数,是int型。而在python3里,/的结果是真正意义上的除法,结果是float型。所以便出现了Error Message: ‘float’ object cannot be interpreted as an integer。

4、AttributeError: module '_pickle' has no attribute 'HIGHEST_PROTOCOL'

_pickle改为pickle

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值