Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion loadcaffe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void convertProtoToLuaV1(const caffe::NetParameter &netparam, const char* lua_na
int num_output = netparam.input_dim_size();
for (int i=0; i<netparam.layers_size(); ++i)
{
bool ignore = false;
std::vector<std::pair<std::string, std::string>> lines;
auto& layer = netparam.layers(i);
switch(layer.type())
Expand Down Expand Up @@ -324,6 +325,11 @@ void convertProtoToLuaV1(const caffe::NetParameter &netparam, const char* lua_na
lines.emplace_back(layer.name(), "nn.SoftMax()");
break;
}
case caffe::V1LayerParameter::DATA:
{
ignore = true;
break;
}
default:
{
std::cout << "MODULE " << layer.name() << " UNDEFINED\n";
Expand All @@ -333,7 +339,7 @@ void convertProtoToLuaV1(const caffe::NetParameter &netparam, const char* lua_na
if(!lines.empty())
for(auto& it: lines)
ofs << "table.insert(model, {'" << it.first << "', " << it.second << "})\n";
else
else if(!ignore)
{
ofs << "-- warning: module '" << layer.name() << " [type " << layer.type() << "]" << "' not found\n";
std::cout << "warning: module '" << layer.name() << " [type " << layer.type() << "]" << "' not found\n";
Expand Down