caffe:AttributeError: 'module' object has no attribute 'LabelMap' - python-2.7

The caffe is installed on the Ubuntu server,and it test is ok. I just run the following code on the Ubutun(16.04) cloud server:
import caffe
from caffe.proto import caffe_pb2
label_map = caffe_pb2.LabelMap()
and I have run the command as following which provided by the internet, but there is still error:
command:
export PYTHONPATH=$/home2/challenge98/caffe/python:$PYTHONPATH
error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'LabelMap'
Could you guys give me some advices how to solve it. Thanks!

Should install the version of new caffe(https://github.com/weiliu89/caffe) for you work, although you have installed the BVLC caffe. –

Related

ImportError when trying to execute command "from senti_classifier import senti_classifier"

I'm pretty sure that I've correctly installed the sentiment_classifier package on python. I have to use the package on one of my codes. The problem is that the import command is throwing an error. This is what shows up in my command prompt.
from senti_classifier import senti_classifier
Traceback (most recent call last):
File "", line 1, in
File "build\bdist.win32\egg\senti_classifier\senti_classifier.py", line 229, in
ImportError: No module named collections
However when i execute the command "import collections" no error is thrown. I've only recently started learning python and I'm relatively new to it. Any help is appreciated. Thanks!
PS the solution from Sentiment Analysis using senti_classifier and NLTK is not working for me.

How can I import the csvsql to Python 2.7

I have successfuly installed csvkit using conda install ...
However, when I try to import the libraries in Python 2.7 Spyder, I get error messages:
import csvsql
Traceback (most recent call last):
File "<ipython-input-5-303a60a6b1ac>", line 1, in <module>
import csvsql
ImportError: No module named csvsql
import csvkit
Traceback (most recent call last):
File "<ipython-input-7-ca8a99ae9834>", line 1, in <module>
import csvkit
ImportError: No module named csvkit
I looked at the documentation -- they describe the installation process but not how the library is loaded in Python.
Moreover, I had an analogous problem with httplib2. I installed it successfuly but when I tried to import it in Spyder I received an analogous error message (No module named httplib2).
(I use Anaconda 3 and Spyder on Windows 11)
Any ideas? Thank you in advance.
I asked this question on the csvkit GitHub / issues forum.
The answer given was: You should use agate on which csvkit now relies for all its operations. See https://github.com/wireservice/agate.
I'm with you -- it would be wonderful to use csvkit as a command-line tool and a library, but it's authors don't see it that way. The full issue: https://github.com/wireservice/csvkit/issues/670

Installing python lib pymqi for MQ

I am trying to setup python pyqmi. I installed it for python 2.7. Post this when I do "import pymqi" and run it, I see error as-
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\pymqi.py", line 104, in
import pymqe, CMQC, CMQCFC, CMQXC
ImportError: DLL load failed: The specified module could not be found.
I checked all the directory but did not find any python file called pymqe.py. Though I see a decrypted file of same as pymqe.pyd
Can someone please help me understanding what is going wrong here?

Error importing anydbm python 2.7.6

I get the following error when trying to import anydbm in python 2.7.6. Does anyone know whats going wrong? Appreciate your help.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/anydbm.py", line 50, in <module>
_errors.append(_mod.error)
AttributeError: 'module' object has no attribute 'error'
Try dbm it should work. I know in Python3 anydbm to dbm has been renamed.
import dbm
Reloading the information about available software in Ubuntus Software & Updates GUI fixed the problem.

AttributeError: 'module' object has no attribute 'version'

I am working on learning how to use pandas but get the following error:
Traceback (most recent call last):
File "data_frame.py", line 2, in <module>
import pandas as pd
File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/__init__.py", line 13, in <module>
__import__(dependency)
File "/Users/gregwinter/numpy.py", line 22, in <module>
from pandas.compat.numpy_compat import *
File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/compat/numpy_compat.py", line 15, in <module>
_np_version = np.version.short_version
AttributeError: 'module' object has no attribute 'version'
I have no idea how to fix this. Anything you can tell be on how to fix this would be great.
You named a file of your own numpy.py:
/Users/gregwinter/numpy.py
Guess which one Python thinks pandas wants to import? :-) Rename your program, and remove any .pyc or .pyo files that are around.
I experienced this same problem after upgrading Jupyter, but did not have a local file named numpy.py. I was able to fix the issue on an Anaconda build by uninstalling/reinstalling pandas using: conda remove pandas and then conda install pandas
Problem was fixed.
I meet the some error, but the error for my situation is in mmcv library. I solve it with
pip install --upgrade packaging
here is reference link, hope this could help you.