NameError: name 'wrap_train' is not defined : somoclu Version: 1.7.5 in windows
hanzigs opened this issue · comments
Hi,
I am getting the error which I can see the different issues for the same in discussions dating back from 2016,
som_clu.train()
Traceback (most recent call last):
File "<ipython-input-196-fe94f553b2c4>", line 1, in <module>
som_clu.train()
File "C:\ProgramData\Anaconda3\lib\site-packages\somoclu\train.py", line 222, in train
wrap_train(np.ravel(self._data), epochs, self._n_columns, self._n_rows,
NameError: name 'wrap_train' is not defined
import somoclu
Warning: the binary library cannot be imported. You cannot train maps, but you can load and analyze ones that you have already saved.
If you installed Somoclu with pip on Windows, this typically means missing DLLs. Please refer to the documentation.
may i know the correct solutions please?
I am using windows, in Anaconda spyder IDE
Thanks
Hi @xgdgsc , May I know any suggestions available please?
I'm having the same issue with Python version 3.7.4 and Somoclu version 1.7.5 . Somoclu 1.7.5 works fine with python 3.6, but with python 3.7.4 I get the same errors as you. However Somoclu version 1.7.4 works fine on python 3.7.4
Thanks @sahautal, I have Python 3.7.0, somoclu 1.7.4 worked.
Python 3.7.4 or 3.7.0 with Somoclu 1.7.4 didnt work for me, neither Python 3.6 with Somoclu 1.7.5 :(
I'm having the exact same problem. Tried manually setting the ddls, nothing. I tried downgrading versions and still. with 3.7+ nothing works. Same behavior on 3.8.2.
I uploaded https://files.pythonhosted.org/packages/bf/1d/8f2a89cd9a0f37fe3a8ba114f43e310a832f5f30f7f3d886e6379ab2e722/somoclu-1.7.5.1.tar.gz . You can try run python setup.py install
after extracting. Before that you should install visual studio with visual c++ compilers. From my testing it works.
Hey,
I'm having the same problem here, NameError: name 'wrap_train' is not defined
.
- I'm using the somoclu version 1.7.5.1 (already tried 1.7.4 and 1.7.5);
- Already ran
python setup.py install
successfuly; - Already installed
libiomp5md
,msvcp90
,msvcr90
andvcomp90
; - Also, I have visual studio with visual c++ compilers.
Warning: passing the data in the constructor is deprecated.
Warning: data was not float32. A 32-bit copy was made
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<timed eval> in <module>
~\Anaconda3\lib\site-packages\somoclu\train.py in train(self, data, epochs, radius0, radiusN, radiuscooling, scale0, scaleN, scalecooling)
220 self.umatrix.shape = (self._n_rows * self._n_columns, )
221 self.bmus.shape = (self.n_vectors * 2, )
--> 222 wrap_train(np.ravel(self._data), epochs, self._n_columns, self._n_rows,
223 self.n_dim, self.n_vectors, radius0, radiusN,
224 radiuscooling, scale0, scaleN, scalecooling,
NameError: name 'wrap_train' is not defined
Any ideia? Thank you
Which version of VS? I only tested latest .
@xgdgsc @pedromaiapatinha Any update on this? Still an issue for me. Everything is latest. I only got as far as figuring out that setup.py fails to compile with error code 2. But it doesn't fail the process, so unless you scroll up you won't know it failed, it reports that install was successful. As the result _somoclu_wrap.pyd isn't getting created and I get the above error.
Thanks in advance for any tips towards a solution.
It worked for me using this solution (https://www.scivision.dev/python-windows-visual-c-14-required) for installing the 1.7.5.1 version, the error does not appear anymore. However my Jupyter Notebook kernel dies everytime I try to train data, even small datasets. Windows 10 64 bits, Anaconda 3, Python 3.8.
@xgdgsc @pedromaiapatinha Any update on this? Still an issue for me. Everything is latest. I only got as far as figuring out that setup.py fails to compile with error code 2. But it doesn't fail the process, so unless you scroll up you won't know it failed, it reports that install was successful. As the result _somoclu_wrap.pyd isn't getting created and I get the above error.
Thanks in advance for any tips towards a solution.
I run ito the same issue as @rodiegeology . I also tried to run it in python directly, but the result remains the same: The python interpreter dies.
Do I understand correctly that - to get somoclu up and running on windows - I have to have Visual Studio? Visual Studio Build Tools are not sufficient for this task?
it works on Ubuntu20.04(conda install somoclu -c conda-forge), but fails on windows10(conda install somoclu -c conda-forge), anyone help?
Hi, I'm having this same error with somoclu but with a Macbook M1 pro, I see that the 1.7.5.1 change above is pushed to pypi but it fails to actually build locally:
Discarding https://files.pythonhosted.org/packages/bf/1d/8f2a89cd9a0f37fe3a8ba114f43e310a832f5f30f7f3d886e6379ab2e722/somoclu-1.7.5.1.tar.gz (from https://pypi.org/simple/somoclu/): Requested somoclu from file:///Users/maxwest/Library/Caches/pip/wheels/47/89/ab/0932352d0a0a8ceebb91b937bd4de854ec6927f4ab6c78b7b4/somoclu-1.7.5-py3-none-any.whl has inconsistent version: expected '1.7.5.1', but metadata has '1.7.5'
Uploaded src package 1.7.6 to pypi.
Conda updated with M1 build, please test if you have a M1 device.
Hello, I'm using Python 3.9.12 and Somoclu 1.7.5 on Windows and I still get the error NameError: name 'wrap_train' is not defined