diff --git a/src/net.cpp b/src/net.cpp index 50c2a4cd1627..c06c410fed1c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1271,9 +1271,10 @@ Layer* Net::create_custom_layer(int index) int Net::forward_layer(int layer_index, std::vector& blob_mats, Option& opt) const { + printf("dims %d\n", blob_mats[0].dims); const Layer* layer = layers[layer_index]; -// fprintf(stderr, "forward_layer %d %s\n", layer_index, layer->name.c_str()); + if (layer->one_blob_only) { @@ -1283,7 +1284,15 @@ int Net::forward_layer(int layer_index, std::vector& blob_mats, Option& opt if (blob_mats[bottom_blob_index].dims == 0) { + printf("needing %s \n", blobs[bottom_blob_index].name.c_str()); + printf("forwarding_layer %d %s\n", blobs[bottom_blob_index].producer, + layers[blobs[bottom_blob_index].producer]->name.c_str()); int ret = forward_layer(blobs[bottom_blob_index].producer, blob_mats, opt); + printf("forwarded_layer %d %s\n", blobs[bottom_blob_index].producer, + layers[blobs[bottom_blob_index].producer]->name.c_str()); + printf("dims of %s : %d %d %d\n", blobs[bottom_blob_index].name.c_str(), blob_mats[bottom_blob_index].c, + blob_mats[bottom_blob_index].h, + blob_mats[bottom_blob_index].w); if (ret != 0) return ret; } @@ -1348,7 +1357,17 @@ int Net::forward_layer(int layer_index, std::vector& blob_mats, Option& opt if (blob_mats[bottom_blob_index].dims == 0) { - int ret = forward_layer(blobs[bottom_blob_index].producer, blob_mats, opt); + printf("needing %s \n", blobs[bottom_blob_index].name.c_str()); + + printf("forwarding_layer %d %s\n", blobs[bottom_blob_index].producer, + layers[blobs[bottom_blob_index].producer]->name.c_str()); + int ret = forward_layer(blobs[bottom_blob_index].producer, blob_mats, opt); + printf("forwarded_layer %d %s\n", blobs[bottom_blob_index].producer, + layers[blobs[bottom_blob_index].producer]->name.c_str()); + printf("dims of %s: %d %d %d\n", blobs[bottom_blob_index].name.c_str(), blob_mats[bottom_blob_index].c, + blob_mats[bottom_blob_index].h, + blob_mats[bottom_blob_index].w); + if (ret != 0) return ret; } diff --git a/tools/caffe/caffe2ncnn.cpp b/tools/caffe/caffe2ncnn.cpp index 32f02e32350e..689cd5549c9f 100644 --- a/tools/caffe/caffe2ncnn.cpp +++ b/tools/caffe/caffe2ncnn.cpp @@ -390,10 +390,17 @@ int main(int argc, char** argv) // global definition line // [layer count] [blob count] int layer_count = proto.layer_size(); + int layer_suppl = 0; + int blob_suppl = 0; std::set blob_names; for (int i=0; i