tensorflow: Error on Windows when installed in a virtualenv that has a non-ASCII character in the path

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 10 x64

  • TensorFlow installed from (source or binary): binary from PyPI

  • TensorFlow version (use command below): 1.1.0

  • Exact command to reproduce:

    from tensorflow.contrib.rnn.python.ops.gru_ops import *
    

Describe the problem

I encountered this when importing keras but it’s reproducible with the command above. My virtualenv is in a folder that has an accented character in its name (see the log below). If I install TensorFlow globally, it works.

Source code / logs

D:\Marci\Programozás\algorimp\test>venv\scripts\python -c "from tensorflow.contrib.rnn.python.ops.gru_ops import *"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\__init__.py", line 26, in <module>
    from tensorflow.contrib import crf
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\crf\__init__.py", line 32, in <module>
    from tensorflow.contrib.crf.python.ops.crf import _lengths_to_masks
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\crf\python\ops\crf.py", line 44, in <module>
    from tensorflow.contrib.rnn.python.ops import core_rnn_cell
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\rnn\__init__.py", line 80, in <module>
    from tensorflow.contrib.rnn.python.ops.gru_ops import *
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\rnn\python\ops\gru_ops.py", line 32, in <module>
    resource_loader.get_path_to_datafile("_gru_ops.so"))
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\util\loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\python\framework\load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: D:\Marci\Programozás\algorimp\test\venv\lib\site-packages\tensorflow\contrib\rnn\python\ops\_gru_ops.dll not found

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I have got a similar issue like marczellm.

  • Operating system: Windows 10
  • Tensorflow version: tensorflow-gpu 1.1.0 (pip installation, in python 3.5.3 environment)
  • IDE: PyCharm

Although I got tensorflow installed, the following command throws an error:

from tensorflow.examples.tutorials.mnist import mnist

Error:

"C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\python.exe" "C:/Users/Raphaël Baur/PycharmProjects/untitled8/y.py"
Traceback (most recent call last):
  File "C:/Users/Raphaël Baur/PycharmProjects/untitled8/y.py", line 1, in <module>
    from tensorflow.examples.tutorials.mnist import mnist
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\examples\tutorials\mnist\__init__.py", line 21, in <module>
    from tensorflow.examples.tutorials.mnist import input_data
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\examples\tutorials\mnist\input_data.py", line 29, in <module>
    from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\__init__.py", line 26, in <module>
    from tensorflow.contrib import crf
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\crf\__init__.py", line 32, in <module>
    from tensorflow.contrib.crf.python.ops.crf import _lengths_to_masks
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\crf\python\ops\crf.py", line 44, in <module>
    from tensorflow.contrib.rnn.python.ops import core_rnn_cell
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\__init__.py", line 80, in <module>
    from tensorflow.contrib.rnn.python.ops.gru_ops import *
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\python\ops\gru_ops.py", line 32, in <module>
    resource_loader.get_path_to_datafile("_gru_ops.so"))
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\util\loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\python\framework\load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow\contrib\rnn\python\ops\_gru_ops.dll not found

Process finished with exit code 1

So somehow “_gru_ops.dll” is not found, altough it is located in the indicated directory (output from my terminal):

C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\Lib\site-packages\tensorflow\contrib\rnn\python\ops>ls
__init__.py  _gru_ops.dll   core_rnn.py       core_rnn_cell_impl.py  gru_ops.py   rnn.py
__pycache__  _lstm_ops.dll  core_rnn_cell.py  fused_rnn_cell.py      lstm_ops.py  rnn_cell.py

It could be because I’m an new to programming and tensorflow specifically, but this issue puzzles me, especially since tensorflow seems to actually work when running this code:

import tensorflow as tf

hello = tf.constant('Hello, GitHub!')
sess = tf.Session()
print(sess.run(hello))

Output:

"C:\Users\Raphaël Baur\AppData\Local\Programs\Python\Python35\python.exe" "C:/Users/Raphaël Baur/PycharmProjects/untitled8/test.py"
2017-06-07 13:21:29.922172: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.922508: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.922818: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.923126: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.923433: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.923730: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.924007: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:29.924284: W c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-06-07 13:21:30.346729: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:887] Found device 0 with properties: 
name: GeForce GTX 970M
major: 5 minor: 2 memoryClockRate (GHz) 1.038
pciBusID 0000:01:00.0
Total memory: 6.00GiB
Free memory: 5.02GiB
2017-06-07 13:21:30.347086: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:908] DMA: 0 
2017-06-07 13:21:30.347259: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:918] 0:   Y 
2017-06-07 13:21:30.347459: I c:\tf_jenkins\home\workspace\release-win\device\gpu\os\windows\tensorflow\core\common_runtime\gpu\gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 970M, pci bus id: 0000:01:00.0)
b'Hello, GitHub!'

Process finished with exit code 0

Any form of help concerning that issue would be extremely appreciated (I am really beginning to despair).