深度学习报错集合(自用>>>持续更新)

安装任何环境

1、版本冲突

别整pip install tensorflow=1.4啥的,需要自己配版本很容易出问题

应该装个conda

conda install tensorflow=1.13.1 直接一键适配安装(cuda/cudnn都自动配置)

实在conda install找不到才用pip指定版本安装(情况很少)

Tensorflow

1、IndentationError: unexpected indent

代码缩进有问题

2、TypeError: Fetch argument 5 has invalid type <class 'int'>, must be a string or Tensor. (Can not convert a int into a Tensor or Operation.)

把int32 换成float32

3、Tensor("Add:0", shape=(), dtype=float32)

因为你还没输出

session = tf.compat.v1.Session()

print(session.run(y))

session.close()

Pytorch报错集合

1、ModuleNotFoundError: No module named 'past'

conda install future

2、FutureWarning: Passing (type, 1) or '1type' as a synon 

版本太高

conda uninstall numpy 

conda install numpy=1.16.0

3、TensorBoard logging requires TensorBoard with Python summary writer installed.

一般都是tensorboard版本和tensorflow有问题,后面会有提示,卸载之前的再安装就是了 

 4、zsh: illegal hardware instruction  tensorboard --logdir logs(Mac)

多半没有装tensorflow

conda install tensorflow

5、requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8097): 

安装超时,换下载源

pip install grpcio-tools -i https://pypi.doubanio.com/simple

6、EOFError: Compressed file ended before the end-of-stream marker was reached

数据集下载有问题,删除重新下载 

 dgango报错集合

1、AttributeError: ‘str’ object has no attribute ‘decode’

点最后一个报错地方文件,将decode改为encode

在一起的报错三连:完美解决python manage.py makemigrations 报错_xbean1028的博客-CSDN博客

2、与mysql交互控制台不乱码,浏览器乱码 

添加json_dumps_params={'ensure_ascii': False}

return JsonResponse({'code': 1, 'data': contents}, json_dumps_params={'ensure_ascii': False})

3、 django post方法403报错

在settings.py里面的MIDDLEWARE_CLASSES中去掉“‘django.middleware.csrf.CsrfViewMiddleware’,”

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

江河地笑

实践是检验真理的唯一标准

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值