I was successfully able to install nltk and I have all the prerequisites installed as well.
Nonetheless I have been receiving error messages like these while importing nltk.
>>> import nltk
Traceback (most recent call last):
File "<pyshell#9>", line 1, in <module>
import nltk
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\nltk\__init__.py", line 128, in <module>
from nltk.chunk import *
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\nltk\chunk\__init__.py", line 157, in <module>
from nltk.chunk.api import ChunkParserI
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\nltk\chunk\api.py", line 13, in <module>
from nltk.parse import ParserI
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\nltk\parse\__init__.py", line 79, in <module>
from nltk.parse.transitionparser import TransitionParser
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\nltk\parse\transitionparser.py", line 21, in <module>
from sklearn.datasets import load_svmlight_file
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\datasets\__init__.py", line 6, in <module>
from .base import load_breast_cancer
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\datasets\base.py", line 20, in <module>
from ..utils import Bunch
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\utils\__init__.py", line 11, in <module>
from .validation import (as_float_array,
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\utils\validation.py", line 23, in <module>
from ..externals.joblib import Memory
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\externals\joblib\__init__.py", line 127, in <module>
from .parallel import Parallel
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\externals\joblib\parallel.py", line 25, in <module>
from ._multiprocessing_helpers import mp
File "C:\Users\Saurav\AppData\Local\Programs\Python\Python36-32\lib\site-
packages\sklearn\externals\joblib\_multiprocessing_helpers.py", line 24, in
<module>
_sem = mp.Semaphore()
AttributeError: module 'multiprocessing' has no attribute 'Semaphore'
Related
I'm trying to run an object detection training on Tensorflow
Everything is working fine until I start training the network, here.
python C:\RealTimeObjectDetection-main\Tensorflow/models/research/object_detection/model_main_tf2.py --model_dir=C:\RealTimeObjectDetection-main\Tensorflow\workspace/models/my_ssd_mobnet --pipeline_config_path=C:\RealTimeObjectDetection-main\Tensorflow\workspace/models/my_ssd_mobnet/pipeline.config --num_train_steps=200000
It produces the following error:
Traceback (most recent call last):
File "C:\RealTimeObjectDetection-main\Tensorflow/models/research/object_detection/model_main_tf2.py", line 32, in <module>
from object_detection import model_lib_v2
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\object_detection\model_lib_v2.py", line 29, in <module>
from object_detection import eval_util
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\object_detection\eval_util.py", line 35, in <module>
slim = tf.contrib.slim
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\util\lazy_loader.py", line 63, in __getattr__
return getattr(module, item)
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\contrib\__init__.py", line 39, in <module>
from tensorflow.contrib import compiler
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 21, in <module>
from tensorflow.contrib.compiler import jit
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 22, in <module>
from tensorflow.contrib.compiler import xla
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\contrib\compiler\xla.py", line 22, in <module>
from tensorflow.python.estimator import model_fn as model_fn_lib
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\estimator\model_fn.py", line 26, in <module>
from tensorflow_estimator.python.estimator import model_fn
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 27, in <module>
from tensorflow_estimator.python.estimator import estimator
File "C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 36, in <module>
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace' from 'tensorflow.python.profiler' (C:\Users\m8\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_core\python\profiler\__init__.py)
Software I am using: Windows 10 - amd64, Python 3.7.0, TensorFlow 1.15.5
You can import this using latest Tensorflow version 2.6.
from tensorflow.python.profiler import trace
I have written a Python layer that puts bottom into an array (im), squeezes the dimension and prints the shape of array (im_shape).
caffe is raising the following error, even after recompiling it again, I am getting this error. Could someone please help me why this error is shown?
I
1222 01:37:59.268040 3566 layer_factory.hpp:77] Creating layer print_shape
Traceback (most recent call last):
File "/home/user/caffe/python/print_layer.py", line 1, in <module>
import caffe
File "/home/user/caffe/python/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/user/caffe/python/caffe/pycaffe.py", line 11, in <module>
import numpy as np
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/core/__init__.py", line 74, in <module>
from numpy.testing.nosetester import _numpy_tester
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/site-packages/numpy/testing/__init__.py", line 10, in <module>
from unittest import TestCase
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/unittest/__init__.py", line 64, in <module>
from .main import TestProgram, main
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/unittest/main.py", line 7, in <module>
from . import loader, runner
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/unittest/runner.py", line 7, in <module>
from .signals import registerResult
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/unittest/signals.py", line 2, in <module>
import weakref
File "/home/user/anaconda2/envs/testcaffe/lib/python2.7/weakref.py", line 14, in <module>
from _weakref import (
ImportError: cannot import name _remove_dead_weakref
I have this error and I do not know how to fix it I have tried many meneras and I do not know how I created new post because the other was badly
Traceback (most recent call last):
File "run.py", line 9, in <module>
from layer import MacLayer
File "/root/MacBot/layer.py", line 5, in <module>
from app import main
File "/root/MacBot/app/main.py", line 8, in <module>
from app.yesno.yesno import YesNo
File "/root/MacBot/app/yesno/yesno.py", line 2, in <module>
import moviepy.editor as mp
File "/usr/local/lib/python3.5/dist-packages/moviepy-0.2.2.11-py3.5.egg/moviepy/editor.py", line 22, in <module>
from .video.io.VideoFileClip import VideoFileClip
File "/usr/local/lib/python3.5/dist-packages/moviepy-0.2.2.11-py3.5.egg/moviepy/video/io/VideoFileClip.py", line 3, in <module>
from moviepy.video.VideoClip import VideoClip
File "/usr/local/lib/python3.5/dist-packages/moviepy-0.2.2.11-py3.5.egg/moviepy/video/VideoClip.py", line 15, in <module>
import numpy as np
File "/usr/lib/python3/dist-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/usr/lib/python3/dist-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/lib/python3/dist-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/lib/python3/dist-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 6, in <module>
from . import multiarray
ImportError: cannot import name 'multiarray'
Easiest solution is to use anaconda available from continuum.io/downloads
then you aren't messing with compiling this yourself.
I am having trouble importing numpy into my project. I am using python 2.7.10 and when i try to run the script i get the error :
Traceback (most recent call last):
File "test.py", line 2, in <module>
import numpy as np
File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 58, in <module>
from numpy.testing import Tester
File "/usr/local/lib/python2.7/site-packages/numpy/testing/__init__.py", line 14, in <module>
from .utils import *
File "/usr/local/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
from tempfile import mkdtemp
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in <module>
import io as _io
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: dlopen(/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions /2.7/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyCodecInfo_GetIncrementalDecoder
Referenced from: /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/li b/python2.7/lib-dynload/_io.so
Expected in: flat namespace
in /usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/li b/python2.7/lib-dynload/_io.so
Any ideas on whats causing the issue?
I had installed sphinx and Jasper on my RPI. When I'm trying to start Jasper - i got this:
Traceback (most recent call last):
File "/home/pi/jasper/jasper.py", line 14, in <module>
from client import vocabcompiler, stt, jasperpath
File "/home/pi/jasper/client/stt.py", line 6, in <module>
import requests
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 58, in <module>
from . import utils
File "/usr/local/lib/python2.7/dist-packages/requests/utils.py", line 25, in <module>
from .compat import parse_http_list as _parse_list_header
File "/usr/local/lib/python2.7/dist-packages/requests/compat.py", line 7, in <module>
from .packages import charade as chardet
File "/usr/local/lib/python2.7/dist-packages/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connectionpool.py", line 33, in <module>
from .connection import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/connection.py", line 41, in <module>
from .util import (
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/__init__.py", line 18, in <module>
from .retry import Retry
File "/usr/local/lib/python2.7/dist-packages/requests/packages/urllib3/util/retry.py", line 4, in <module>
from ..exceptions import (
ImportError: cannot import name ProtocolError
Who can help me with this error? Thank you
you should
pip install urllib3