Code Monkey home page Code Monkey logo

caffe-yolo9000's People

Contributors

choasup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

caffe-yolo9000's Issues

problems training 2-class detector

Hi , i want to train a 2-class detector on caffe-yolo9000 , but i can't use the pretrained caffemodel that you provided cause it was trained on VOC which has 20 classes , otherwise it will report the error "Cannot copy param 0 weights from layer 'conv_reg'; shape mismatch. Source param shape is 125 1024 1 1 (12 8000); target param shape is 30 1024 1 1 (30720)."Is there some way to convert the yolo v2 weights into caffemodel , or how can i trained without pretrained model?
Thanks a lot!

Why the codes is gone?

Although I don't know why you remove all the codes, maybe you find some problems in codes or other reasons, I think you can let us modify the problems together and solve the problem more efficient. And you can contact me by email [email protected]!

loss layer

hei,I have a question is that in detection loss layer, why label is check equal to 1+1+1+4? why not 1+20+4? hope your reply~

caffe version

hi choasUp
it seems that u use a old version caffe.
So i meet some problems while move the box_data_layer to my caffe.
eg. BlockingQueue<shared_ptrDataReader::QueuePair, BlockingQueue<P2PSync>, etc.

did u build new caffe-yolo9000 base on new caffe?
or could u please tell me how to rewrite this layer?

region_loss_layer error

Hi there~,
meet with following error. any one met this too?

I1130 19:54:53.791607 9868 sgd_solver.cpp:115] Iteration 75, lr = 0.0001
F1130 19:57:52.550586 9868 region_loss_layer.cpp:275] Check failed: swap_data[index] >= 0 (-nan vs. 0)
*** Check failure stack trace: ***
@ 0x7f52ba0eedaa (unknown)
@ 0x7f52ba0eece4 (unknown)
@ 0x7f52ba0ee6e6 (unknown)
@ 0x7f52ba0f1687 (unknown)
@ 0x7f52ba8007b6 caffe::RegionLossLayer<>::Forward_cpu()
@ 0x7f52ba845b57 caffe::Net<>::ForwardFromTo()
@ 0x7f52ba845ea7 caffe::Net<>::Forward()
@ 0x7f52ba8678a7 caffe::Solver<>::Step()
@ 0x7f52ba8682d9 caffe::Solver<>::Solve()
@ 0x40920b train()
@ 0x405ce3 main
@ 0x7f52b8dbeec5 (unknown)
@ 0x406528 (unknown)
@ (nil) (unknown)
Aborted (core dumped)

related code as following:


for (int b = 0; b < swap.num(); ++b)
  for (int c = 0; c < swap.channels(); ++c)
for (int h = 0; h < swap.height(); ++h)
{
  int index = b * swap.channels() * swap.height() * swap.width() + c * swap.height() * swap.width() + h * swap.width() + 4;
  swap_data[index] = sigmoid(swap_data[index]);
  
  CHECK_GE(swap_data[index], 0); ////////////////////////
}

yolo_weights

Hello! In the file 'train_darknet_v3.sh', weights is gnet_yolo_region_darknet_v3_pretrain_iter_600000.caffemodel. Where is the weights? How can I train to get it?

Build error

Hi Choasup,
First of all, thanks for your project!
Is this master branch building? I tried and could not build it.
Best regards,
Elvys

I cannot "make all" for Makefile:616: recipe for target '.build_release/tools/extract_features.bin' failed

when I compile the code, encounter the error as follow:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0-rc3
CXX/LD -o .build_release/tools/extract_features.bin
CXX/LD -o .build_release/tools/finetune_net.bin
CXX/LD -o .build_release/tools/convert_box_data.bin
CXX/LD -o .build_release/tools/compute_image_mean.bin
.build_release/lib/libcaffe.so: undefined reference to caffe::curandGetErrorString(curandStatus)' .build_release/lib/libcaffe.so: undefined reference to caffe::SyncedMemory::async_gpu_push(CUstream_st* const&)'
.build_release/lib/libcaffe.so: undefined reference to caffe::cublasGetErrorString(cublasStatus_t)' collect2: error: ld returned 1 exit status Makefile:616: recipe for target '.build_release/tools/extract_features.bin' failed make: *** [.build_release/tools/extract_features.bin] Error 1 make: *** Waiting for unfinished jobs.... .build_release/lib/libcaffe.so: undefined reference to caffe::curandGetErrorString(curandStatus)'
.build_release/lib/libcaffe.so: undefined reference to caffe::SyncedMemory::async_gpu_push(CUstream_st* const&)' .build_release/lib/libcaffe.so: undefined reference to caffe::cublasGetErrorString(cublasStatus_t)'
collect2: error: ld returned 1 exit status
Makefile:616: recipe for target '.build_release/tools/convert_box_data.bin' failed
make: *** [.build_release/tools/convert_box_data.bin] Error 1
.build_release/lib/libcaffe.so: undefined reference to caffe::curandGetErrorString(curandStatus)' .build_release/lib/libcaffe.so: undefined reference to caffe::SyncedMemory::async_gpu_push(CUstream_st* const&)'
.build_release/lib/libcaffe.so: undefined reference to `caffe::cublasGetErrorString(cublasStatus_t)'
collect2: error: ld returned 1 exit status
Makefile:616: recipe for target '.build_release/tools/compute_image_mean.bin' failed
make: *** [.build_release/tools/compute_image_mean.bin] Error 1
Could you help me for that?

YOLO9000-CAFFE

Hello ,

I am an interster of YOLO9000 .And I want to learn YOLO900 by CAFFE, so Could you give a copy code of
YOLO9000-CAFFE .

THANK YOU VERY MUCH.

My email is [email protected]

YOLO-9000

Hello ,

I am intersted in YOLO9000 .Could you give a copy code of YOLO9000-CAFFE .

THANK YOU VERY MUCH.

Weights file missing for PascalVOC training?

Hi,
First of all, thanks for publishing your implementation of YOLO9000!
Following up a previous question about the missing caffemodel:
WEIGHTS=./gnet_yolo_region_darknet_v3_pretrain_iter_600000.caffemodel
Could you make it available even it the training was not optimal?

Otherwise, could you specify which caffe configuration files (solver and prototxt) you used for training it?

Thanks

about this cpp “eval_detection_layer.cpp”

Hello,choasup
when compile caffe-yolo9000 project,when i put "eval_detection_layer.cpp" file in the project,it has the errors like "src/caffe/layers/eval_detection_layer.cpp: In member function ‘virtual void caffe::EvalDetectionLayer::LayerSetUp(const std::vector<caffe::Blob>&, const std::vector<caffe::Blob>&)’:
src/caffe/layers/eval_detection_layer.cpp:328:10: error: ‘names
’ was not declared in this scope
names_.push_back(name);
^
src/caffe/layers/eval_detection_layer.cpp:329:10: error: ‘width_’ was not declared in this scope
width_.push_back(width);
^_
"
so but when i take the cpp file away,the compile will be ok,so how to solve this problem?and what is that file for?and it this file affect the training?thanks!

how to solve the error when ./train_darknet_v3.sh

[libprotobuf ERROR google/protobuf/text_format.cc:298] Error parsing text-format caffe.SolverParameter: 12:8: Message type "caffe.SolverParameter" has no field named "stagelr".
F0417 16:28:56.909394 25717 upgrade_proto.cpp:1063] Check failed: ReadProtoFromTextFile(param_file, param) Failed to parse SolverParameter file: ./gnet_region_solver_darknet_v3.prototxt
*** Check failure stack trace: ***
@ 0x7fda32843bfd google::LogMessage::Fail()
@ 0x7fda32845a6f google::LogMessage::SendToLog()
@ 0x7fda32843793 google::LogMessage::Flush()
@ 0x7fda3284638e google::LogMessageFatal::~LogMessageFatal()
@ 0x7fda38130b8e caffe::ReadSolverParamsFromTextFileOrDie()
@ 0x409fc1 train()
@ 0x4076bc main
@ 0x7fda2884fb35 __libc_start_main
@ 0x40817c (unknown)

无法正常收敛

你好,choasup:
修复便宜的问题后可以启动训练,但好像无法正常收敛,请问有什么解决方法吗?

The question about the different between darknet-yolo2 and caffe-yolo9000

Hello, thank you for the code caffe-yolo9000, i have some question:
question 1: why multiply -1.0 in the region_layer_loss.cpp(caffe-yolo9000), but no multiply the -1.0 in the region_layer.c(darknet-yolo2),for example,
the file region_layer.c in the darknet-yolo2:
float delta_region_box(box truth, float x, float biases, int n, int index, int i, int j, int w, int h, float delta, float scale)
{
box pred = get_region_box(x, biases, n, index, i, j, w, h);
float iou = box_iou(pred, truth);
//????????
float tx = (truth.x
w - i);
float ty = (truth.y
h - j);
float tw = log(truth.w
w / biases[2n]);
float th = log(truth.h
h / biases[2*n + 1]);

delta[index + 0] = scale * (tx - logistic_activate(x[index + 0])) * logistic_gradient(logistic_activate(x[index + 0]));//sigmoid gradient = f(x)*(1-f(x))
delta[index + 1] = scale * (ty - logistic_activate(x[index + 1])) * logistic_gradient(logistic_activate(x[index + 1]));
delta[index + 2] = scale * (tw - x[index + 2]);
delta[index + 3] = scale * (th - x[index + 3]);
return iou;

}
and in forward_region_layer,for example,
l.delta[index + 4] = l.noobject_scale * ((0 - l.output[index + 4]) * logistic_gradient(l.output[index + 4]));
l.delta[best_index + 4] = l.object_scale * (1 - l.output[best_index + 4]) * logistic_gradient(l.output[best_index + 4]);//

the file region_loss_layer.c in the caffe-yolo9000:
Dtype delta_region_box(vector truth, Dtype* x, vector biases, int n, int index, int i, int j, int w, int h, Dtype* delta, float scale){
vector pred;
pred.clear();
pred = get_region_box(x, biases, n, index, i, j, w, h);

float iou = Calc_iou(pred, truth);
//LOG(INFO) << pred[0] << "," << pred[1] << "," << pred[2] << "," << pred[3] << ";"<< truth[0] << "," << truth[1] << "," << truth[2] << "," << truth[3];
float tx = truth[0] * w - i; //0.5
float ty = truth[1] * h - j; //0.5
float tw = log(truth[2] * w / biases[2n]); //truth[2]=biases/w tw = 0
float th = log(truth[3] * h / biases[2
n + 1]); //th = 0

delta[index + 0] =# (-1.0) * scale * (tx - sigmoid(x[index + 0])) * sigmoid(x[index + 0]) * (1 - sigmoid(x[index + 0]));
delta[index + 1] =# (-1.0) * scale * (ty - sigmoid(x[index + 1])) * sigmoid(x[index + 1]) * (1 - sigmoid(x[index + 1]));
delta[index + 2] =# (-1.0) * scale * (tw - x[index + 2]);
delta[index + 3] =# (-1.0) * scale * (th - x[index + 3]);
return iou;
}
and loss function in the RegionLossLayer::Forward_cpu,for example,
diff[index + 4] = # (-1.0) * noobject_scale_ * (0 - swap_data[index + 4]) * (swap_data[index + 4]) * (1 - swap_data[index + 4]);
diff[best_index + 4] = # (-1.0) * object_scale_ * (1 - swap_data[best_index + 4]) * (swap_data[best_index + 4] * (1 - swap_data[best_index + 4]));

why do you multiply the coefficient -1.0?

question 2:

Do you add the reorg layer in the network? when add the reorg_layer, the train process is not convergence.

some trouble when preparing data.

Dear choasup :
Great job for your yolo9000 with caffe!!

When i was preparing data.
./create_data.sh , and it shows :
image file: /home/data/leecheer/choas/datasets/PASCOL_VOC/VOC2007/VOCdevkit/VOC2007/JPEGImages/009679.jpg does not exist
annofation file: /home/data/leecheer/choas/datasets/PASCOL_VOC/VOC2007/VOCdevkit/VOC2007/Annotations/009679.xml does not exist
I cant' find the two files, could you give some advices. thx!

looking forward to your help!!

Problems detection for my own data

Hi, I want to train a 40-classes detector with yolo9000. After changing num_class and num_output, I run train.sh. The data in train.log is ok, and I try to run test.sh( I've changed the number 'int num_class = ' in test_detection.cpp, and make again). However the data in test.log is rediculous (eg. iter_loss=260). What else I have to change in test_detection.cpp?
I also try to run test.ipynb, and change the following code:
label_name ={??}
swap = np.zeros((1313,5,??))
for c in range(??):
swap[h
13+w][c/??][c%??] = res[c][h][w]
for p in range(??):
But the output picture can't show anything, so how can I deal with it?
Thanks!

want to test YOLO9000 in caffe

Hi ChoasUp,

I'm trying to convert YOLO9000 into caffe framework. However, the region layer is not easy to achieve. Really appreciate if you would like to share your code or the converted YOLO9000 caffemodel. Thanks a lot!

My email address: [email protected]

Best Regards,
Mike

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.