当前位置:网站首页>TensorFlow2 安装快速避坑汇总
TensorFlow2 安装快速避坑汇总
2022-07-25 09:23:00 【Tobi_Obito】
前言
本来以为已经摸索到了稳妥的TF2安装流程(conda python/cudatoolkit/cudnn + pip tf2),没想到安装成功后import个Adam都报错-_-||。故在此博文记录汇总经历过的问题。
快速避坑
情形一
安装顺利完成,但import基本组件(如tensorflow.keras.optimizer.Adam)时报错
解决方案
安装完成后,检查(conda list命令)是否有独立的Keras库:若有,保证其与tensorflow版本一致。
若不一致,则卸载重装keras库:
pip uninstall keras
pip install kears==2.x.0 # 与tensorflow相同的版本
问题分析
在Tensorflow2中keras本来已经集成在tensorflow中,但部分源码仍使用从keras库直接调用的方式:
from keras.某模块 import 某组件
然而,事实证明,虽然独立的keras库是在安装tensorflow的过程中作为依赖库一并安装的,但是版本并未与tensorflow统一,这是各种“不该”报错却报错的原因。
更多情形待遇到后补充...
边栏推荐
- 单目深度估计自监督模型Featdepth解读(上)——论文理解和核心源码分析
- Mixed supervision for surface-defect detection: from weakly to fully supervised learning:表面缺陷检测的混合监督
- *6-1 CCF 2015-03-2 numerical sorting
- First knowledge of opencv4.x --- drawing shapes on images
- UI - infinite rotation chart and column controller
- @3-1 CCF 2020-09-1 scale detection point query
- 降低程序空间复杂度的一些技巧
- Android & kotlin: puzzle solution
- 初识Opencv4.X----为图像添加高斯噪声
- Dream set sail (the first blog)
猜你喜欢

The shortest path problem Bellman Ford (single source shortest path) (illustration)

Segmentation-based deep-learning approach for surface-defectdetection(基于分割的表面缺陷深度学习检测方法)

Raspberry sect door ban system based on face recognition

kotlin基础知识点

*6-2 CCF 2015-03-3 Festival

Object initialization

Voice chat app source code - produced by NASS network source code

UI - infinite rotation chart and column controller

*6-3 save small experts

@2-1 safety index predicted by CCF at the end of December 1, 2020
随机推荐
MySQL与Navicat安装和踩坑
A picture explains SQL join left and right
Some operations of main function
MLOps专栏介绍
pytorch使用tensorboard实现可视化总结
In depth interpretation of C language random number function and how to realize random number
2022年的个人技术选型梳理
Constant power wireless charging based on stm32
SurfaceView 闪屏(黑一下问题)
基于stm32的恒功率无线充电
expect+sh实现自动交互
初识Opencv4.X----图像直方图绘制
单目深度估计基础理论和论文学习总结
[deep learning] convolutional neural network
初识Opencv4.X----为图像添加高斯噪声
如何安装pytorch?—— 一种最简单有效的方法!
[code source] daily problem segmentation (nlogn & n solution)
Kotlin realizes file download
Customize dialog to realize the pop-up box of privacy clause statement imitating Netease cloud music
[data mining] Chapter 3 basis of data analysis