Home > other >  After running keras, constantly Using TensorFlow backend, but already installed TensorFlow
After running keras, constantly Using TensorFlow backend, but already installed TensorFlow

Time:09-19

Novice learning tensorflow, but ran into problems, please the great god glad

My computer is Windows 7, 64 - bit, direct use PIP to install, PIP is 18.1

My code is this:

! The/usr/bin/env python
# coding: utf-8

The import keras
The from keras. Datasets import mnist
The from keras. The layers import Sequential
The from keras. Optimizers import RMSprop
The from tensorflow. Examples. Tutorials. Mnist import input_data
Batch_size=128
Num_classes=10
MNIST_data mnist=input_data. Read_data_sets ("/")
X_train, y_train=mnist. "train". Images and mnist. Train. Labels
X_test, y_test=mnist. Test. Images and mnist. Test. Labels
Print (x_train shape, y_train. Shape)
Print (x_test shape, y_test. Shape)

Y_train=keras. Utils. To_categorically (y_train num_classes)
Y_test=keras. Utils. To_categorically (y_test num_classes)

The model=Sequential ()
Model. The add (Dense (512, activation='relu' input_shape=(784,)))
Model. The add (Dropout (0.2))
Model. The add (Dense (512, activation='relu'))
Model. The add (Dropout (0.2))
Model. The add (Dense (num_classes, activation='softmax'))
# the summary to the model, ould see the data and infomation about shape in every layer
Model. The summary ()

Model.com from running (loss='categorical_crossentropy',
Optimizer=RMSprop (),
The metrics=[' accuracy '])


But, after the operation, has been an error, an error is as follows:

Using TensorFlow backend.
Traceback (the most recent call last) :
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow py", 58, line in & lt; module>
The from tensorflow. Python. Pywrap_tensorflow_internal import *
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow_internal py", 28, the line in & lt; module>
_pywrap_tensorflow_internal=swig_import_helper ()
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow_internal py", line 24, in swig_import_helper
_mod=imp. Load_module (' _pywrap_tensorflow_internal, fp, the pathname, description)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ imp py", line 243, in the load_module
Return load_dynamic (name, filename, file)
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ imp py", line 343, in load_dynamic
Return _load (spec)
ImportError: DLL load failed with the error code - 1073741795

During handling of the above exception, another exception occurred:

Traceback (the most recent call last) :
The File "C: \ Users \ \ Administrator \ AppData \ Roaming \ Sublime does Text 3/Packages/User/keras111 \ numpy111 \ num py", line 4, the in & lt; module>
The import keras
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ keras \ set py", line 3, the in & lt; module>
From the import utils
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ keras \ utils \ set py", line 6, the in & lt; module>
From the import conv_utils
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ keras \ utils \ conv_utils py", line 9, the in & lt; module>
The from.. The import backend as K
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages, keras, backend, set py", line 89, in & lt; module>
From the tensorflow_backend import *
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ keras \ backend \ tensorflow_backend py", line 5, in & lt; module>
The import tensorflow as tf
File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ set py", line 24, in & lt; module>
The from tensorflow. Python import pywrap_tensorflow # pylint: disable=unused - import
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ set py", line 49, in & lt; module>
The from tensorflow. Python import pywrap_tensorflow
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow py", line 74, in & lt; module>
Raise ImportError (MSG)
ImportError: Traceback (the most recent call last) :
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow py", 58, line in & lt; module>
The from tensorflow. Python. Pywrap_tensorflow_internal import *
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow_internal py", 28, the line in & lt; module>
_pywrap_tensorflow_internal=swig_import_helper ()
The File "C: \ Users \ \ Administrator \ \ AppData \ Local \ designed \ Python Python35 \ lib \ site - packages \ tensorflow \ Python \ pywrap_tensorflow_internal py", line 24, in swig_import_helper
_mod=imp. Load_module (' _pywrap_tensorflow_internal, fp, the pathname, description)
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related