Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues in importing keras #34148

Closed
karthikeyan-DS-BOT opened this issue Nov 11, 2019 · 13 comments
Closed

issues in importing keras #34148

karthikeyan-DS-BOT opened this issue Nov 11, 2019 · 13 comments
Assignees
Labels
subtype:windows Windows Build/Installation Issues TF 1.13 Issues related to TF 1.13 type:build/install Build and install issues

Comments

@karthikeyan-DS-BOT
Copy link

karthikeyan-DS-BOT commented Nov 11, 2019

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):win 7 64 bit
  • TensorFlow installed from (source or binary): installed using anaconda prompt
  • TensorFlow version (or github SHA if from source): 1:13;1

DESCRIPTION : I run it using CPU , I have installed using the this command : conda install -c conda-forge keras in conda prompt

Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 7.6.1 -- An enhanced Interactive Python.
CODE:

from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense

LOG:

from keras.models import Sequential
from keras.layers import Convolution2D
from keras.layers import MaxPooling2D
from keras.layers import Flatten
from keras.layers import Dense
Using TensorFlow backend.
Traceback (most recent call last):

File "", line 1, in
from keras.models import Sequential

File "C:\Users\User\Anaconda3\lib\site-packages\keras_init_.py", line 3, in
from . import utils

File "C:\Users\User\Anaconda3\lib\site-packages\keras\utils_init_.py", line 6, in
from . import conv_utils

File "C:\Users\User\Anaconda3\lib\site-packages\keras\utils\conv_utils.py", line 9, in
from .. import backend as K

File "C:\Users\User\Anaconda3\lib\site-packages\keras\backend_init_.py", line 1, in
from .load_backend import epsilon

File "C:\Users\User\Anaconda3\lib\site-packages\keras\backend\load_backend.py", line 90, in
from .tensorflow_backend import *

File "C:\Users\User\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in
import tensorflow as tf

File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow_init_.py", line 24, in
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import

File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\python_init_.py", line 49, in
from tensorflow.python import pywrap_tensorflow

File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in
raise ImportError(msg)

ImportError: Traceback (most recent call last):
File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\User\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
_mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
File "C:\Users\User\Anaconda3\lib\imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\User\Anaconda3\lib\imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: DLL load failed with error code -1073741795

Failed to load the native TensorFlow runtime.
Also, please include a link to a GraphDef or the model if possible.

@dubesar
Copy link
Contributor

dubesar commented Nov 11, 2019

I think your issue is same as #27984
Please go through this issue and ping if not solved.

@karthikeyan-DS-BOT
Copy link
Author

karthikeyan-DS-BOT commented Nov 11, 2019 via email

@karthikeyan-DS-BOT
Copy link
Author

I think your issue is same as #27984
Please go through this issue and ping if not solved.

sir, could you explain me what to do next , i saw the issuse but i dont knw what to do , im a beginner

@dubesar
Copy link
Contributor

dubesar commented Nov 11, 2019

https://github.com/fo40225/tensorflow-windows-wheel

Download TensorFlow binaries from the link above. Since you are using CPU

@karthikeyan-DS-BOT
Copy link
Author

karthikeyan-DS-BOT commented Nov 11, 2019

https://github.com/fo40225/tensorflow-windows-wheel

Download TensorFlow binaries from the link above. Since you are using CPU

sir i click that green clone or download button its downloading more than 500mb,i dont know whether its right or wrong since im using cpu , i might have downloaded the wrong file , is there any specific library file or a link. after downloading should i need to directly install or i should paste it somewhere?? please mention the link of cpu tensorflow binaries i can directly downlaod. i dont know wht it is .. im new to coding sir

@dubesar
Copy link
Contributor

dubesar commented Nov 11, 2019

@karthikeyan-DS-BOT read the readme you will find the solution. Specifically your concern is also mentioned there

@ymodak
Copy link
Contributor

ymodak commented Nov 11, 2019

TensorFlow release binaries version 1.6 and higher are prebuilt with AVX instruction sets.

Therefore on any CPU that does not have these instruction sets, either CPU or GPU version of TF will fail to load.
Apparently, your CPU model does not support AVX instruction sets. You can still use TensorFlow with the alternatives given below:

  • Try Google Colab to use TensorFlow.
    • The easiest way to use TF will be to switch to google colab.You get pre-installed latest stable TF version. Also you can usepip install to install any other preferred TF version.
    • It has an added advantage since you can you easily switch to different hardware accelerators (cpu, gpu, tpu) as per the task.
    • All you need is a good internet connection and you are all set.
  • If unable to find prebuilt binaries without avx instructions sets then you may ; Try to build TF from sources by changing CPU optimization flags.

@gowthamkpr gowthamkpr assigned gowthamkpr and unassigned gowthamkpr Nov 11, 2019
@karthikeyan-DS-BOT
Copy link
Author

karthikeyan-DS-BOT commented Nov 12, 2019 via email

@gadagashwini-zz gadagashwini-zz self-assigned this Nov 12, 2019
@gadagashwini-zz gadagashwini-zz added TF 1.13 Issues related to TF 1.13 subtype:windows Windows Build/Installation Issues type:build/install Build and install issues labels Nov 12, 2019
@gadagashwini-zz
Copy link
Contributor

gadagashwini-zz commented Nov 12, 2019

@karthikeyan-DS-BOT,
Please follow the steps mentioned below to install Tenosrflow using conda
Set Up Anaconda Environments
conda create --name tf_2.0.0
Activate the new Environment
source activate tf_2.0.0
Install Tf 2.0
conda install tensorflow=2.0 python=3.7

Steps to install Tensorflow using PIP:
$pip install virtualenv
$virtualenv tf_2.0.0 # tf_2.0.0 is virtual env name
$source tf_2.0.0/bin/activate
tf_2.0.0 $ pip install tensorflow==2.0.0

Let us know how it progresses. Thanks!

@gadagashwini-zz gadagashwini-zz added the stat:awaiting response Status - Awaiting response from author label Nov 12, 2019
@karthikeyan-DS-BOT
Copy link
Author

@karthikeyan-DS-BOT,
Please follow the steps mentioned below to install Tenosrflow using conda
Set Up Anaconda Environments
conda create --name tf_2.0.0
Activate the new Environment
source activate tf_2.0.0
Install Tf 2.0
conda install tensorflow=2.0 python=3.7

Steps to install Tensorflow using PIP:
$pip install virtualenv
$virtualenv tf_2.0.0 # tf_2.0.0 is virtual env name
$source tf_2.0.0/bin/activate
tf_2.0.0 $ pip install tensorflow==2.0.0

Let us know how it progresses. Thanks!

Thnks!!! ill try and let you know if it works

@tensorflowbutler tensorflowbutler removed the stat:awaiting response Status - Awaiting response from author label Nov 13, 2019
@karthikeyan-DS-BOT
Copy link
Author

@karthikeyan-DS-BOT,
Please follow the steps mentioned below to install Tenosrflow using conda
Set Up Anaconda Environments
conda create --name tf_2.0.0
Activate the new Environment
source activate tf_2.0.0
Install Tf 2.0
conda install tensorflow=2.0 python=3.7
Steps to install Tensorflow using PIP:
$pip install virtualenv
$virtualenv tf_2.0.0 # tf_2.0.0 is virtual env name
$source tf_2.0.0/bin/activate
tf_2.0.0 $ pip install tensorflow==2.0.0
Let us know how it progresses. Thanks!

Thnks!!! ill try and let you know if it works

thanks buddy , it really worked.

@tensorflow-bot
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

@gadagashwini-zz
Copy link
Contributor

@karthikeyan-DS-BOT, Glad to know that it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subtype:windows Windows Build/Installation Issues TF 1.13 Issues related to TF 1.13 type:build/install Build and install issues
Projects
None yet
Development

No branches or pull requests

6 participants