Deep-Learning icon indicating copy to clipboard operation
Deep-Learning copied to clipboard

Does not compile without errors in Python 3.6.4 64 bits

Open knudvaneeden opened this issue 7 years ago • 2 comments

Hi, I tried to compile the Word2Vec CBOW example at e.g. https://github.com/abaheti95/Deep-Learning/blob/master/word2vec/keras/cbow_model.py but that failed. Could you please check. Python 3.6.4 in 64 bits. Thanks

E.g.

Using TensorFlow backend. Traceback (most recent call last): File "ddd.py", line 5, in from keras.utils.np_utils import accuracy ImportError: cannot import name 'accuracy'

I tried to pip3.6.exe install np_utils pip3.6.exe install future pip3.6.exe install tensorflow pip3.6.exe install numpy

===

Further also e.g. the line

import global_settings as G

gives a can not be found error.

knudvaneeden avatar Mar 14 '18 00:03 knudvaneeden

@knudvaneeden I think I have implemented it on Theano backend. I hadn't tested this on Tensorflow backend as I don't know how to use Tensorflow. Also this is was a hobby weekend thing. My original plan was not a fast implementation. If you want to use word2vec for your own project, I will still recommend the original C-code or maybe the gensim version. However, if you want to make it work on Tensorflow, your contributions are welcome.

global_settings.py is present in the folder. I think importing that file should not be troublesome.

abaheti95 avatar Mar 14 '18 14:03 abaheti95

@ashutoshbaheti

Yes, gensim I have already looked at and implemented some application around it which calls gensim. As far as I know, the developer of gensim, Radim Rehurek, actually used that C code to make the gensim port. See e.g. https://github.com/cod3licious/word2vec/blob/master/README.md

Only worked with TensorFlow, never used Theano .

But your reply has for sure already given more information, I will check further, including possibly that C code also. Thanks.

knudvaneeden avatar Mar 14 '18 15:03 knudvaneeden