Closed zhubuntu closed 8 years ago
sorry for late reply. It should be usable using something like this:
Symbol cropped = Crop("cropped", 1, offset, h_w)(to_be_cropped_symbol)
or
Symbol cropped = Crop("cropped", 2)(to_be_cropped_symbol, shape_symbol)
@hjk41 Thanks,I try what you say ,but it reports
错误 33 error C2064: 项不会计算为接受 2 个参数的函数
and
错误 39 IntelliSense: 在没有适当 operator() 的情况下调用类类型的对象或将函数转换到指向函数的类
So I change the
inline Symbol Crop(const std::string& symbol_name,
int num_args,
Shape offset = Shape(0, 0),
Shape h_w = Shape(0, 0),
bool center_crop = false) {
return Operator("Crop")
.SetParam("num_args", num_args)
.SetParam("offset", offset)
.SetParam("h_w", h_w)
.SetParam("center_crop", center_crop)
.CreateSymbol(symbol_name);
}
to
inline Symbol Crop(const std::string& symbol_name,
int num_args,
Symbol data,
Symbol crop_like,
Shape offset = Shape(0, 0),
Shape h_w = Shape(0, 0),
bool center_crop = false) {
return Operator("Crop")
.SetParam("num_args", num_args)
.SetParam("offset", offset)
.SetParam("h_w", h_w)
.SetParam("center_crop", center_crop)
.SetInput("arg0", data)
.SetInput("arg1", crop_like)
.CreateSymbol(symbol_name);
}
for a temporary solution.
Great move. Let me see why the code I posted does not work and fix it.
On Mon, Mar 28, 2016 at 6:35 PM, zhubuntu notifications@github.com wrote:
@hjk41 https://github.com/hjk41 Thanks,I try what you say ,but it reports
错误 33 error C2064: 项不会计算为接受 2 个参数的函数 and 错误 39 IntelliSense: 在没有适当 operator() 的情况下调用类类型的对象或将函数转换到指向函数的类
So I change the
inline Symbol Crop(const std::string& symbol_name, int num_args, Shape offset = Shape(0, 0), Shape h_w = Shape(0, 0), bool center_crop = false) { return Operator("Crop") .SetParam("num_args", num_args) .SetParam("offset", offset) .SetParam("h_w", h_w) .SetParam("center_crop", center_crop) .CreateSymbol(symbol_name); }
to
inline Symbol Crop(const std::string& symbol_name, int num_args, Symbol data, Symbol crop_like, Shape offset = Shape(0, 0), Shape h_w = Shape(0, 0), bool center_crop = false) { return Operator("Crop") .SetParam("num_args", num_args) .SetParam("offset", offset) .SetParam("h_w", h_w) .SetParam("center_crop", center_crop) .SetInput("arg0", data) .SetInput("arg1", crop_like) .CreateSymbol(symbol_name); }
for a temporary solution.
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dmlc/MXNet.cpp/issues/16#issuecomment-202336346
HONG Chuntao System Research Group Microsoft Research Asia
I have found the C++ wrapper of crop at here,but I don't know how to use it. In caffe model,the crop has two input and one output,but in this c++ wrapper,it shows
I don't know where to define the input symbol,and in the comment ,it also says