9

My environment is as follows:

* Windows 7, 64 bit
* Anaconda Navigator 1.8.7
* python 3.6.5
* tensorflow 1.8.0

In python, I type:

import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data

i got error as follows:

>>> from tensorflow.examples.tutorials.mnist import input_data
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\examples\tutorials\mnist\__init__.py", line 21, in <module>
    from tensorflow.examples.tutorials.mnist import input_data
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\examples\tutorials\mnist\input_data.py", line 30, in <module>
    from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\__init__.py", line 34, in <module>
    from tensorflow.contrib import data
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\data\__init__.py", line 67, in <module>
    from tensorflow.contrib.data.python.ops.error_ops import ignore_errors
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\data\python\ops\error_ops.py", line 20, in <module>
    from tensorflow.contrib.data.python.ops import contrib_op_loader  # pylint: disable=unused-import
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\data\python\ops\contrib_op_loader.py", line 24, in <module>
    resource_loader.get_path_to_datafile("../../_dataset_ops.so"))
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\util\loader.py", line 56, in load_op_library
    ret = load_library.load_op_library(path)
  File "E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\python\framework\load_library.py", line 56, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: E:\Anaconda3\envs\opencv\lib\site-packages\tensorflow\contrib\data\python\ops\..\..\_dataset_ops.so not found
>>>

It also pops up a window saying:

The procedure entry point ?addcleanup@arenaimpl@internal@protobuf@google@@QEAAXPEAXP6AX0@Z@Z could not be located in the dynamic link library _pywarp_tensorflow_internal.pyd

Please help. thank you very much in advance.

Warmest Regards, Suryadi

3
  • Check: stackoverflow.com/questions/50666681/… Commented Jun 11, 2018 at 15:46
  • I run code at your link, got error: ---> 16 train_image.shape = (10, 784) NameError: name 'train_image' is not defined Commented Jun 11, 2018 at 16:22
  • 1
    There is no train_image refined as part of the code, its a comment. Make sure you copy the code correctly, i just tried it and its working fine. Commented Jun 11, 2018 at 16:28

2 Answers 2

11

Both tensorflow.examples.tutorials.mnist and tf.contrib.learn.datasets.load_dataset('mnist') are throwing deprecated warnings. You can load through keras datasets :

(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data().

You can check on how to load the mnist and use it for training here: How to load MNIST via TensorFlow (including download)?.

Sign up to request clarification or add additional context in comments.

Comments

1

You should also convert the image data to a floating point representation.

 mnist_train, mnist_test = tf.keras.datasets.mnist.load_data()
 train_data = np.float16(mnist_train[0])  # Returns np.array
 train_labels = np.asarray(mnist_train[1], dtype=np.int32)
 eval_data = np.float16(mnist_test[0])  # Returns np.array
 eval_labels = np.asarray(mnist_test[1], dtype=np.int32)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.