Проблемы с Tensorflow на Pycharm windows - PullRequest
0 голосов
/ 13 апреля 2020

Я новичок в python и пытаюсь выполнить базовый c код тензорного потока, найденного в github

import tensorflow as tf
 import tensorflow_io as tfio

d_train = tfio.IODataset.from_mnist(
'http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz',
'http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz').batch(1)

# By default image data is uint8 so conver to float32.
d_train = d_train.map(lambda x, y: (tf.image.convert_image_dtype(x, tf.float32), y))

 model = tf.keras.models.Sequential([
 tf.keras.layers.Flatten(input_shape=(28, 28)),
 tf.keras.layers.Dense(512, activation=tf.nn.relu),
 tf.keras.layers.Dropout(0.2),
 tf.keras.layers.Dense(10, activation=tf.nn.softmax)
 ])
 model.compile(optimizer='adam',
          loss='sparse_categorical_crossentropy',
          metrics=['accuracy'])

  model.fit(d_train, epochs=5, steps_per_epoch=10000)
  }

со следующими конфигурациями

enter image description here

Я сталкиваюсь с указанной ниже ошибкой даже после проверки с несколькими совместимыми версиями tenorflow и tenorflowio. Может кто-нибудь, пожалуйста, помогите мне решить эту проблему.

  [1]: https://i.stack.imgur.com/Z1Q3fTraceback (most recent call last):
  File "C:\Users\***\Local\Programs\Python\Python36\venv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "C:\Program Files\JetBrains\PyCharm Community Edition 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\****\Local\Programs\Python\Python36\venv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 28, in <module>
    _pywrap_tensorflow_internal = swig_import_helper()
  File "C:\Users\****\Local\Programs\Python\Python36\venv\lib\site-packages\tensorflow_core\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
  File "C:\Users\****\Local\Programs\Python\Python36\lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "C:\Users\****\Local\Programs\Python\Python36\lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
.png
...