Code Monkey home page Code Monkey logo

Comments (15)

nshaud avatar nshaud commented on June 18, 2024

Are you using our Caffe fork ?

You should have done :

# Initialize and checkout our custom Caffe fork (upsample branch !)
git submodule init

git submodule update

Then, you can use Caffe in Python either by adding our fork to the PYTHON_PATH or manually in your script :

import sys
sys.path.insert(0, '/path/to/DeepNetsForEO/caffe/python')

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud Thank you, I change your Caffe for,now it work. but when i trained the caffemodel, i got the wrong result:
I0314 17:45:18.172921 6023 solver.cpp:238] Train net output #0: accuracy = 0.404126
I0314 17:45:18.172945 6023 solver.cpp:238] Train net output #1: loss = 1.32147 (* 1 = 1.32147 loss)
I0314 17:45:18.172952 6023 solver.cpp:238] Train net output #2: per_class_accuracy = 0.712315
I0314 17:45:18.172974 6023 solver.cpp:238] Train net output #3: per_class_accuracy = 0.291166
I0314 17:45:18.172979 6023 solver.cpp:238] Train net output #4: per_class_accuracy = 0.00170741
I0314 17:45:18.172986 6023 solver.cpp:238] Train net output #5: per_class_accuracy = 4.86287e-05
I0314 17:45:18.172992 6023 solver.cpp:238] Train net output #6: per_class_accuracy = 0
I0314 17:45:18.173008 6023 solver.cpp:238] Train net output #7: per_class_accuracy = 0
I0314 17:45:18.173024 6023 sgd_solver.cpp:105] Iteration 800, lr = 0.01

I also don't understand why set BGR=True, i use the Vaihingen irrg data , is it reverse the channel order to g r ir? can you give me some advices.

from deepnetsforeo.

nshaud avatar nshaud commented on June 18, 2024

Yes, BGR=True reverses the order of the channels. E.g, if you use IRRG data, the LMDB will actually be GRIR. Our pre-trained weights use this format.

If you are training your own model, it should take around 40000 iterations (with a batch size of 10) before convergence.

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud I increased the training times to 40000,but it still wrong. I found that at the beginning of the train net output the first four class accuracy are not zero,however,at the end of the training only the top of 2 are not zero :

I0315 14:30:36.392210  2502 solver.cpp:238]     Train net output #0: accuracy = 0.16449
I0315 14:30:36.392230  2502 solver.cpp:238]     Train net output #1: loss = 2.09245 (* 1 = 2.09245 loss)
I0315 14:30:36.392246  2502 solver.cpp:238]     Train net output #2: per_class_accuracy = 0.270436
I0315 14:30:36.392251  2502 solver.cpp:238]     Train net output #3: per_class_accuracy = 0.121069
I0315 14:30:36.392258  2502 solver.cpp:238]     Train net output #4: per_class_accuracy = 0.0145857
I0315 14:30:36.392266  2502 solver.cpp:238]     Train net output #5: per_class_accuracy = 0.175652
I0315 14:30:36.392271  2502 solver.cpp:238]     Train net output #6: per_class_accuracy = 0.239834
I0315 14:30:36.392287  2502 solver.cpp:238]     Train net output #7: per_class_accuracy = 0
I0315 14:30:36.392294  2502 sgd_solver.cpp:105] Iteration 0, lr = 0.01
/usr/lib/python2.7/dist-packages/numpy/core/_methods.py:59: RuntimeWarning: .
  warnings.warn("Mean of empty slice.", RuntimeWarning)
/usr/lib/python2.7/dist-packages/numpy/core/_methods.py:70: RuntimeWarning: invalid value encountered in double_scalars
  ret = ret.dtype.type(ret / rcount)
iter 0, train_loss=2.092453                                                     
  0%|             | 100/40000 [00:20<2:11:38,  5.05it/s]I0315 14:30:56.584589  2502 solver.cpp:219] Iteration 100 (4.95231 iter/s, 20.1926s/100 iters), loss = 1.52628
I0315 14:30:56.584635  2502 solver.cpp:238]     Train net output #0: accuracy = 0.303955
I0315 14:30:56.584646  2502 solver.cpp:238]     Train net output #1: loss = 1.52628 (* 1 = 1.52628 loss)
I0315 14:30:56.584655  2502 solver.cpp:238]     Train net output #2: per_class_accuracy = 0.772755
I0315 14:30:56.584677  2502 solver.cpp:238]     Train net output #3: per_class_accuracy = 0.23393
I0315 14:30:56.584699  2502 solver.cpp:238]     Train net output #4: per_class_accuracy = 0.00012333
I0315 14:30:56.584704  2502 solver.cpp:238]     Train net output #5: per_class_accuracy = 0.00130501
I0315 14:30:56.584710  2502 solver.cpp:238]     Train net output #6: per_class_accuracy = 0
I0315 14:30:56.584717  2502 solver.cpp:238]     Train net output #7: per_class_accuracy = 0
I0315 14:30:56.584724  2502 sgd_solver.cpp:105] Iteration 100, lr = 0.01
iter 100, train_loss=1.526283                                                   
  0%|▏                                    | 200/40000 [00:40<2:14:46,  4.92it/s]I0315 14:31:16.698926  2502 solver.cpp:219] Iteration 200 (4.97154 iter/s, 20.1145s/100 iters), loss = 1.3434


100%|██████████████████ | 39900/40000 [3:56:21<00:19,  5.20it/s]I0315 18:26:57.442383  2502 solver.cpp:219] Iteration 39900 (1.57393 iter/s, 63.5351s/100 iters), loss = 1.32824
I0315 18:26:57.442427  2502 solver.cpp:238]     Train net output #0: accuracy = 0.353693
I0315 18:26:57.442440  2502 solver.cpp:238]     Train net output #1: loss = 1.32824 (* 1 = 1.32824 loss)
I0315 18:26:57.442446  2502 solver.cpp:238]     Train net output #2: per_class_accuracy = 0.00656828
I0315 18:26:57.442471  2502 solver.cpp:238]     Train net output #3: per_class_accuracy = 0.999583
I0315 18:26:57.442476  2502 solver.cpp:238]     Train net output #4: per_class_accuracy = 0
I0315 18:26:57.442482  2502 solver.cpp:238]     Train net output #5: per_class_accuracy = 0
I0315 18:26:57.442488  2502 solver.cpp:238]     Train net output #6: per_class_accuracy = 0
I0315 18:26:57.442503  2502 solver.cpp:238]     Train net output #7: per_class_accuracy = 0
I0315 18:26:57.442510  2502 sgd_solver.cpp:105] Iteration 39900, lr = 0.001

Besides,there are several warning messages:

I0315 14:30:35.096953  2502 layer_factory.cpp:91] cuDNN does not support multiple tops. Using Caffe's own pooling layer.

upsample_layer.cpp:31] Params 'pad_out_{}_' are deprecated. Please declare upsample height and width useing the upsample_h, upsample_w parameters.

need help thanks:)

from deepnetsforeo.

nshaud avatar nshaud commented on June 18, 2024

Those warnings are not critical, you can safely ignore them.

On what data are you training the network ? The Vaihingen dataset ?

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

yes, i use The Vaihingen dataset

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud

from deepnetsforeo.

nshaud avatar nshaud commented on June 18, 2024

It seems that you are only learning the 'building' class. Can you check the classification achieves good results using the provided pre-trained weights ?

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud
yes,i run the reference.py with the segnet_vaihingen_128x128_fold1_iter_60000.caffemodel ,and have got a good result

from deepnetsforeo.

nshaud avatar nshaud commented on June 18, 2024

Did you change anything in the training script file ? Or in the training prototxt ?

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud i just change the path of dataset in the prototxt:
data_param {
source: "path/to/your/train/lmdb" # E

from deepnetsforeo.

nshaud avatar nshaud commented on June 18, 2024

Could you paste the full prototxt that you used ? How did you generate the LMDB ? Can you check (using Python) that the Caffe Blobs inside the network are OK ? i.e. by using the Python Caffe API checking that net.blobs['data'].data and net.blobs['label'].data have not been corrupted somehow ?

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

@nshaud thanks for the solution,I re-download the code and regenerate the database,now the traning results are correct. I have modified the code before , it maybe have made something wrong

from deepnetsforeo.

momozizi avatar momozizi commented on June 18, 2024

Hello
I have also same problem ('LayerParameter' object has no attribute 'scale' ). but I could not solve it. would you please guide me step by step. I used caffe version 1.0.0 on windows7.

from deepnetsforeo.

zht3344 avatar zht3344 commented on June 18, 2024

you should make sure your classes number is correct, if not, you need to modify the corresponding network parameters @momozizi

from deepnetsforeo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.