tensorflow Word2Vec错误 [英] tensorflow Word2Vec error

查看:163
本文介绍了tensorflow Word2Vec错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面的github中下载了word2vec的源代码。
https://github.com/tensorflow/models/blob/master/tutorials/embedding/word2vec.py
我在pycharm上使用tensorflow 。
我正在使用Windows10。
我安装了在Windows上使用tensorflow所需的tensorflow,python,numpy。
在word2vec.py源代码中,我设置了 savepath trainpath evalpath
我从源代码建议的 http://mattmahoney.net/dc/text8.zip
下载了培训文本文件。
但是运行代码时出现以下错误:

I downloaded source code of word2vec in github below. https://github.com/tensorflow/models/blob/master/tutorials/embedding/word2vec.py I am using tensorflow on pycharm. I'm using windows 10. I installed tensorflow, python, numpy which are needed to use tensorflow on windows. In word2vec.py source code, I set the savepath, trainpath, and evalpath. I downloaded the training text file from http://mattmahoney.net/dc/text8.zip which the source code recommended. But when I ran the code I get the error below:


C:\Users\Sungjin\AppData\ \本地\程序\Python\Python35\python.exe
C:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py Traceback(最近的
最近调用):文件
C:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py,第43行,在

word2vec = tf.load_op_library(os.path.join(os.path.dirname(os。 path.realpath(文件)),
'word2vec_o​​ps.so'))文件
C:\Users\Sungjin\AppData\Local\Programs\ Python Python35 lib站点包 tensorflow Python framework load_library.py,
第64行,在load_op_library
中,无,error_msg,error_code) tensorflow.python.framework.errors_impl.NotFoundError:
C:\用户\Sungjin\PycharmProjects\无标题\word2vec_o​​ps.so未找到

C:\Users\Sungjin\AppData\Local\Programs\Python\Python35\python.exe C:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py Traceback (most recent call last): File "C:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py", line 43, in word2vec = tf.load_op_library(os.path.join(os.path.dirname(os.path.realpath(file)), 'word2vec_ops.so')) File "C:\Users\Sungjin\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\Sungjin\PycharmProjects\untitled\word2vec_ops.so not found

进程结束,退出代码为1

Process finished with exit code 1

我在github上检查了Readme.md文件,但是没有关于该文件的其他内容。
看来我必须制作 word2Vec_ops .so文件,但我不知道如何。

I checked Readme.md file on github but there is nothing mentioned about the file. It seems I have to make word2Vec_ops.so file but I don't know how.

推荐答案

您正在使用Windows,.so文件(几乎)等同于DLL文件,但在unix系统下。因此,即使您找到了.so文件,也无法在Windows下运行。

You're using windows and .so files are (almost) the equivalent of DLL files but under unix systems. So, even if you could find the .so file, that wouldn't work under windows.

如果您愿意安装linux并从那里进行所有操作,请在在找到word2vec.py的地方,您还可以找到如何构建.so文件。
https://github.com/tensorflow/models/tree / master / tutorials / embedding ,它表示您将需要按照以下步骤编译操作)。如果您不了解linux和g ++ / gcc的工作方式,则可能应该切换到Windows特定的另一个项目。

If you're willing to install linux and do everything from there, in the same place where you found word2vec.py you can also find how to build the .so file. ( https://github.com/tensorflow/models/tree/master/tutorials/embedding , it says You will need to compile the ops as follows ). If you don't know how linux and g++ / gcc work, you should probably switch to another project that is windows specific.

这篇关于tensorflow Word2Vec错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆