tensorflow Word2Vec error

2024/10/14 16:26:06

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\Local\Programs\Python\Python35\python.exeC:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py Traceback (mostrecent call last): File"C:/Users/Sungjin/PycharmProjects/untitled/ImpW2V.py", line 43, inword2vec = 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_libraryNone, None, error_msg, error_code) tensorflow.python.framework.errors_impl.NotFoundError:C:\Users\Sungjin\PycharmProjects\untitled\word2vec_ops.so not found

Process finished with exit code 1

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.

Answer

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.

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.

https://en.xdnf.cn/q/117936.html

Related Q&A

Mysterious characters at the end of E-Mail, received with socket in python

I am not sure if this is the right forum to ask, but I give it a try. A device is sending an E-Mail to my code in which I am trying to receive the email via a socket in python, and to decode the E-Mail…

Error when importingPython-vlc

I have installed python-vlc D:\Programing\Python\Python 3.6>python -m pip install python-vlc Requirement already satisfied: python-vlc in d:\programing\python\python 3.6\lib\site-packages\python_vlc…

How to use FEniCS in Jupyter Notebook or Spyder?

I have recently installed FEniCS using Docker with following commandTerminal> curl -s https://get.fenicsproject.org | bashEvery thing works well when I am in fenicsproject session. In this session w…

Error installing polyglot in python 3.5.2

I want to do sentiment analysis on urdu sentences. I searched a python package Polyglot having URDU POS tagger in it. But on installing, it prompts error;Any way out?

How do you turn a dict of lists into a list of dicts with all combinations?

Basically what I am looking for is the equivalent of itertools.product but for dicts.For example, say I want to test a function for all combinations of its keyword arguments, I would like to pass lists…

Django differentiate between the first time user and returning user

I am using django registration redux for login and auth purposes. I want to do the following.if the user logs in for the first time i want to redirect to URL-"profile/create" if the user is a…

Automatically cropping an image using Python

I want to automatically crop an image using OpenCV into many images, the number of output images is variable. I started by replacing the white background by a transparent background.The input image: I …

How to find highest product of k elements in an array of n length, where k n

I recently tried the question for the highest product of 3 elements. Now I am trying to do it for the k elements. Lets say from 3 now it is asking for 4 elements. I tried to write a generic function so…

Kivy error - Unable to get a window, abort

I installed kivy on my Raspberry pi3, where i run a python program that already works on another pi3.I now am trying to install the same thing on this second pi, and it doesnt work...maybe I forgot som…

Selenium 3.0.2 error with Firefox 50: executable may have wrong permissions

Im trying to use Selenium 3.0.2 with Firefox 50.0.1 in Windows 7. Ive followed the instructions in this post to setup correctly the driver and the paths but Im getting the following error: Traceback (m…