BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
34.01k stars 18.71k forks source link

AttributeError: module 'caffe' has no attribute 'Net' #6897

Open poornimajd opened 4 years ago

poornimajd commented 4 years ago

Even though i followed the official documentation for caffe installation i still get this error ,Can anyone please help me out with this?I am stuck with this issue since long

gmt710 commented 4 years ago

Hello, Have you resolved this problem?It's so strange.

Shiven004 commented 3 years ago

I am also getting same issue.I couldnt fine Net module in caffe github code. AttributeError: module 'caffe' has no attribute 'Net'

gmt710 commented 3 years ago

@Shiven004 ,The path must be given correct.

Shiven004 commented 3 years ago

@gmt710 Is caffe.Net is Net.py script?

gmt710 commented 3 years ago

The root directory of the Caffe you compiled.

Shiven004 commented 3 years ago

@gmt710 - I am try to invoke the python script py_demo.py from https://github.com/gcucurull/CAM-Python repo in my Collab notebook.I have copied everything including caffe (Caffe github code- https://github.com/BVLC/caffe) on google drive but in the function , there is a piece of code which invokes :

#load CAM model and extract features
net = caffe.Net(net_model, net_weights, caffe.TEST)

But i couldn't fine the Net.py or Net() function in caffe module.

Collab Nb- https://colab.research.google.com/drive/1t_5gXbp-JfnFbo-iumjyylTO-tRZYRZw?usp=sharing Google drive code link- https://drive.google.com/drive/folders/1risZuudq1A1tAIK_kEG0vCLsZ2igHwH-?usp=sharing

Can you guide on this please? I dont think i need to compile in python.

Shiven004 commented 3 years ago

@gmt710 I fixed the issue using !apt install -y caffe-cuda in colab.But now i am getting type error-

 net.blobs['data'].reshape(*np.asarray([1,3,crop_size,crop_size])) # run only one image
TypeError: No registered converter was able to produce a C++ rvalue of type int from this Python object of type numpy.int64
Manchesterunion commented 2 years ago

@Shiven004 Hi , Br, did you slove this problems? I mit the same problems

dafeixia123456 commented 1 year ago

Hi , did you slove this problems? I mit the same problems

Shiven004 commented 1 year ago

not sure i havent worked on it for long now