博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
导入keras报错:module 'tensorflow.python.keras.backend' has no attribute 'get_graph'
阅读量:4087 次
发布时间:2019-05-25

本文共 4505 字,大约阅读时间需要 15 分钟。

主要是因为tensorflow与keras的版本不兼容

import tensorflow

print(tensorflow.__version__)

 

 

Environments

Below is the list of Deep Learning environments supported by FloydHub. Any of these can be specified in the floyd command using the --env option.

If no --env is provided, it uses the tensorflow-1.9 image by default, which comes with Python 3.6, Keras 2.2.0 and TensorFlow 1.9.0 pre-installed.

Framework Env name (--env parameter) Description Docker Image Packages and Nvidia Settings
TensorFlow 2.1 tensorflow-2.1 TensorFlow 2.1.0 + Keras 2.3.1 on Python 3.6.
TensorFlow 2.0 tensorflow-2.0 TensorFlow 2.0.0 + Keras 2.3.1 on Python 3.6.
TensorFlow 1.15 tensorflow-1.15 TensorFlow 1.15.0 + Keras 2.3.1 on Python 3.6.
TensorFlow 1.14 tensorflow-1.14 TensorFlow 1.14.0 + Keras 2.2.5 on Python 3.6.
TensorFlow 1.13 tensorflow-1.13 TensorFlow 1.13.0 + Keras 2.2.4 on Python 3.6.
TensorFlow 1.12 tensorflow-1.12 TensorFlow 1.12.0 + Keras 2.2.4 on Python 3.6.
  tensorflow-1.12:py2 TensorFlow 1.12.0 + Keras 2.2.4 on Python 2.  
TensorFlow 1.11 tensorflow-1.11 TensorFlow 1.11.0 + Keras 2.2.4 on Python 3.6.
  tensorflow-1.11:py2 TensorFlow 1.11.0 + Keras 2.2.4 on Python 2.  
TensorFlow 1.10 tensorflow-1.10 TensorFlow 1.10.0 + Keras 2.2.0 on Python 3.6.
  tensorflow-1.10:py2 TensorFlow 1.10.0 + Keras 2.2.0 on Python 2.  
TensorFlow 1.9 tensorflow-1.9 TensorFlow 1.9.0 + Keras 2.2.0 on Python 3.6.
  tensorflow-1.9:py2 TensorFlow 1.9.0 + Keras 2.2.0 on Python 2.  
TensorFlow 1.8 tensorflow-1.8 TensorFlow 1.8.0 + Keras 2.1.6 on Python 3.6.
  tensorflow-1.8:py2 TensorFlow 1.8.0 + Keras 2.1.6 on Python 2.  
TensorFlow 1.7 tensorflow-1.7 TensorFlow 1.7.0 + Keras 2.1.6 on Python 3.6.
  tensorflow-1.7:py2 TensorFlow 1.7.0 + Keras 2.1.6 on Python 2.  
TensorFlow 1.5 tensorflow-1.5 TensorFlow 1.5.0 + Keras 2.1.6 on Python 3.6.
  tensorflow-1.5:py2 TensorFlow 1.5.0 + Keras 2.1.6 on Python 2.  
TensorFlow 1.4 tensorflow-1.4 TensorFlow 1.4.0 + Keras 2.0.8 on Python 3.6.  
  tensorflow-1.4:py2 TensorFlow 1.4.0 + Keras 2.0.8 on Python 2.  
TensorFlow 1.3 tensorflow-1.3 TensorFlow 1.3.0 + Keras 2.0.6 on Python 3.6.  
  tensorflow-1.3:py2 TensorFlow 1.3.0 + Keras 2.0.6 on Python 2.  
TensorFlow 1.2 tensorflow-1.2 TensorFlow 1.2.0 + Keras 2.0.6 on Python 3.5.  
  tensorflow-1.2:py2 TensorFlow 1.2.0 + Keras 2.0.6 on Python 2.  
TensorFlow 1.1 tensorflow TensorFlow 1.1.0 + Keras 2.0.6 on Python 3.5.  
  tensorflow:py2 TensorFlow 1.1.0 + Keras 2.0.6 on Python 2.  
TensorFlow 1.0 tensorflow-1.0 TensorFlow 1.0.0 + Keras 2.0.6 on Python 3.5.  
  tensorflow-1.0:py2 TensorFlow 1.0.0 + Keras 2.0.6 on Python 2.  
TensorFlow 0.12 tensorflow-0.12 TensorFlow 0.12.1 + Keras 1.2.2 on Python 3.5.  
  tensorflow-0.12:py2 TensorFlow 0.12.1 + Keras 1.2.2 on Python 2.  
PyTorch 1.4 pytorch-1.4 PyTorch 1.4.0 + fastai 1.0.60 on Python 3.6.
PyTorch 1.3 pytorch-1.3 PyTorch 1.3.0 + fastai 1.0.60 on Python 3.6.
PyTorch 1.2 pytorch-1.2 PyTorch 1.2.0 + fastai 1.0.60 on Python 3.6.
PyTorch 1.1 pytorch-1.1 PyTorch 1.1.0 + fastai 1.0.57 on Python 3.6.
PyTorch 1.0 pytorch-1.0 PyTorch 1.0.0 + fastai 1.0.51 on Python 3.6.
  pytorch-1.0:py2 PyTorch 1.0.0 on Python 2.  
PyTorch 0.4 pytorch-0.4 PyTorch 0.4.1 on Python 3.6.
  pytorch-0.4:py2 PyTorch 0.4.1 on Python 2.  
PyTorch 0.3 pytorch-0.3 PyTorch 0.3.1 on Python 3.6.
  pytorch-0.3:py2 PyTorch 0.3.1 on Python 2.  
PyTorch 0.2 pytorch-0.2 PyTorch 0.2.0 on Python 3.5  
  pytorch-0.2:py2 PyTorch 0.2.0 on Python 2.  
PyTorch 0.1 pytorch-0.1 PyTorch 0.1.12 on Python 3.  
  pytorch-0.1:py2 PyTorch 0.1.12 on Python 2.  
Theano 0.9 theano-0.9 Theano rel-0.8.2 + Keras 2.0.3 on Python3.5.  
  theano-0.9:py2 Theano rel-0.8.2 + Keras 2.0.3 on Python2.  
Caffe caffe Caffe rc4 on Python3.5.  
  caffe:py2 Caffe rc4 on Python2.  
Torch torch Torch 7 with Python 3 env.  
  torch:py2 Torch 7 with Python 2 env.  
Chainer 1.23 chainer-1.23 Chainer 1.23.0 on Python 3.  
  chainer-1.23:py2 Chainer 1.23.0 on Python 2.  
Chainer 2.0 chainer-2.0 Chainer 1.23.0 on Python 3.  
  chainer-2.0:py2 Chainer 1.23.0 on Python 2.  
MxNet 1.0 mxnet MxNet 1.0.0 on Python 3.6.  
  mxnet:py2 MxNet 1.0.0 on Python 2.  

All environments are available for both CPU and GPU execution. For example,

To run a Python2 Tensorflow job on CPU

$ floyd run --env tensorflow:py2 "python mnist_cnn.py"

 

To run a Python2 Tensorflow job on GPU (CUDA, cuDNN, etc. installed)

$ floyd run --env tensorflow:py2 --gpu "python mnist_cnn.py"

 

The following software packages (in addition to many other common libraries) are available in all the environments:

h5py, iPython, Jupyter, matplotlib, numpy, OpenCV, Pandas, Pillow, scikit-learn, scipy, sklearn

转载地址:http://drkii.baihongyu.com/

你可能感兴趣的文章
React16常用api解析以及原理剖析
查看>>
教你发布你npm包
查看>>
nvm 和 nrm 的安装与使用
查看>>
React Hooks 一步到位
查看>>
React Redux常见问题总结
查看>>
前端 DSL 实践指南
查看>>
ReactNative: 自定义ReactNative API组件
查看>>
cookie
查看>>
总结vue知识体系之实用技巧
查看>>
PM2 入门
查看>>
掌握 TS 这些工具类型,让你开发事半功倍
查看>>
前端如何搭建一个成熟的脚手架
查看>>
Flutter ListView如何添加HeaderView和FooterView
查看>>
Flutter key
查看>>
Flutter 组件通信(父子、兄弟)
查看>>
Flutter Animation动画
查看>>
Flutter 全局监听路由堆栈变化
查看>>
Android 混合Flutter之产物集成方式
查看>>
Flutter混合开发二-FlutterBoost使用介绍
查看>>
Flutter 混合开发框架模式探索
查看>>