nolearn/lasagne ImportError: No module named layers - python

I am getting an error when I try to run CNN program CNN using my own data set. Im using Python2.7
File "C:\Python27\Lib\site-packages\nolearn\lasagne.py", line 9, in <module>
from lasagne.layers import get_all_layers
ImportError: No module named layers
I already upgrade my libraries before,and when I run the main file,I'm getting this error:
Traceback (most recent call last):
File "C:\Python27\mnis2.py", line 78, in <module>
net1.fit(train, target)
File "C:\Python27\lib\site-packages\nolearn\lasagne.py", line 140, in fit
self._print_layer_info(self.get_all_layers())
File "C:\Python27\lib\site-packages\nolearn\lasagne.py", line 376, in _print_layer_info
output_shape = layer.output_shape()
TypeError: 'tuple' object is not callable

Related

How do I fix this error I get when I import keras into python?

I am trying to import keras into python and keep getting this error. I have checked all of the installs and can not figure out what is going on
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\__init__.py", line 20, in <module>
from . import initializers
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\initializers\__init__.py", line 124, in <module>
populate_deserializable_objects()
File "C:\Users\mpdom\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\initializers\__init__.py", line 82, in populate_deserializable_objects
generic_utils.populate_dict_with_module_objects(
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

AttributeError: module 'torch.utils' has no attribute 'data'

I am trying to run my PyTorch code on a Ubuntu server, it works well on my own computer, but it failed to run on the server.
Is this because of something related to PyTorch version?
This problem seems typical but yet no solutions work.
Traceback (most recent call last):
File "train.py", line 12, in <module>
from data_manager import *
File "/data1/lijun/cross_modal_reid_bigma/transformer/data_manager.py", line 7, in <module>
from util.data_loader import DataLoader
File "/data1/lijun/cross_modal_reid_bigma/transformer/util/data_loader.py", line 6, in <module>
from torchtext.legacy.data import Field, BucketIterator
File "/usr/local/anaconda3/lib/python3.6/site-packages/torchtext/__init__.py", line 3, in <module>
from . import datasets
File "/usr/local/anaconda3/lib/python3.6/site-packages/torchtext/datasets/__init__.py", line 2, in <module>
from .ag_news import AG_NEWS
File "/usr/local/anaconda3/lib/python3.6/site-packages/torchtext/datasets/ag_news.py", line 2, in <module>
from torchtext.data.datasets_utils import _RawTextIterableDataset
File "/usr/local/anaconda3/lib/python3.6/site-packages/torchtext/data/datasets_utils.py", line 205, in <module>
class _RawTextIterableDataset(torch.utils.data.IterableDataset):
AttributeError: module 'torch.utils' has no attribute 'data'
it worked for me...please make sure that you are using 1.7 + pytorch version
When use Pytorch 1.1, You can simply solve this problem by add this import:
import torch.utils.data
And Pytorch 1.7+ has this bug fixed.

DeepLearning application runs well on localhost but crashes on cloud

Error: While importing "app", an ImportError was raised:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
__import__(module_name)
File "/home/ateetk/mysite/Crop_Prediction/app.py", line 12, in <module>
model = pickle.load(open('/home/ateetk/mysite/Crop_Prediction/model.pkl', 'rb'))
ModuleNotFoundError: No module named 'keras'

Pyculib ImportError: cannot import name config

when trying to import pyculib I get ImportError: cannot import name config
I have tried pip installing and conda installing various versions of the cudatoolkit but none seem to work.
import pyculib
I get this error the first time I try to import pyculib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/__init__.py", line 49, in <module>
from . import blas, sparse, fft, rand, sorting
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/__init__.py", line 1, in <module>
from .radixsort import RadixSort
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/radixsort.py", line 38, in <module>
lib = load_lib('radixsort')
File "/home/andillio/anaconda2/lib/python2.7/site-packages/pyculib/sorting/common.py", line 24, in load_lib
libpath = os.path.join(findlib.get_lib_dir(), fullname)
AttributeError: 'module' object has no attribute 'get_lib_dir'
and this error if I try a second time
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named config

ImportError: DLL load failed: The specified module could not be found

I have created a python application using py2exe. when i run this exe/application on my build environment, it works properly. But when i try to run it on clean machine, it gives me a error that,
Traceback (most recent call last):
File "wx\_misc.pyc", line 1358, in Notify
File "wx\_core.pyc", line 14771, in Notify
File "invesalius.py", line 174, in Startup
File "gui\frame.pyc", line 30, in <module>
File "constants.pyc", line 25, in <module>
File "project.pyc", line 31, in <module>
File "vtk\__init__.pyc", line 43, in <module>
File "vtkIOPython.pyc", line 12, in <module>
File "vtkIOPython.pyc", line 10, in __load
ImportError: DLL load failed: The specified module could not be
found.
Traceback (most recent call last):
File "wx\_misc.pyc", line 1358, in Notify
File "wx\_core.pyc", line 14771, in Notify
File "invesalius.py", line 82, in Startup2
AttributeError: 'SplashScreen' object has no attribute 'control'
Traceback (most recent call last):
File "invesalius.py", line 197, in OnClose
AttributeError: 'SplashScreen' object has no attribute 'fc'
I am using:
1. windows 8.1 RTM(64 bit)
2. python (2.7 amd64)
3. py2exe (0.6.10a1)
Any comments will be greatly appreciated...
Sounds like you need a python runtime on the target machine. Does the error message give you any more information about the missing DLL? If there is no further information, there is a Dependency Walker program (depends.exe) that may help you identify the missing dll.

Categories

Resources