Using mxnet pre-trained image classification model in R

435 views Asked by At

Running the tutorial at the link below, I get the error below when I get to the step below. No errors before this point.

http://mxnet.io/tutorials/r/classifyRealImageWithPretrainedModel.html

prob <- predict(model, X=normed) [19:01:35] D:\chhong\mxnet\dmlc-core\include\dmlc/logging.h:235: [19:01:35] d:\chhong\mxnet\src\operator./concat-inl.h:152: Check failed: (dshape[j]) == (tmp[j]) Incorrect shape[2]: (1,320,15,15). (first input shape: (1,576,14,14)) Error: InferShape Error in ch_concat_3c_chconcat: [19:01:35] d:\chhong\mxnet\src\operator./concat-inl.h:152: Check failed: (dshape[j]) == (tmp[j]) Incorrect shape[2]: (1,320,15,15). (first input shape: (1,576,14,14))

2

There are 2 answers

1
Simon Corston-Oliver On

Not sure if the tutorial got fixed or one of the components got fixed but this tutorial executes without errors when testing today on Mac

0
Sergei On

I have run the tutorial on my Windows Server R2 2012 machine with mxnet version 0.10.1 and R version 3.4.3.

It runs okay, and the only thing that went wrong is that on the time I run it at the first time require(mxnet) package returned me:

> require(mxnet)
Loading required package: mxnet
Error: package or namespace load failed for ‘mxnet’:
 object ‘set_global_graph_attrs’ is not exported by 'namespace:DiagrammeR'

I had to install and load DiagrammeR manually to make sure it starts. Here is the code to do so:

# Make sure you have devtools installed already
require(devtools)
install_version("DiagrammeR", version = "0.9.0", repos = "http://cran.us.r-project.org")
require(DiagrammeR)

After that I run the tutorial again and it worked fine.