Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

R-package problem with "predict" function : array shapes mismatch #6919

Description

@ChrisBotella

Environment info

Operating System: Windows 10
Package used : R
MXNet version: 0.10.1 (given by R). I installed the gpu version by following this tutorial https://gist.github.com/thirdwing/89aa9bfc588ade138496e6932072152c one month ago, and it was working fine until now.
R sessionInfo():
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Error Message:

[18:18:32] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\dmlc-core\include\dmlc./logging.h:304: [18:18:32] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor../elemwise_op_common.h:33: Check failed: assign(&dattr, (*vec)[i]) Incompatible attr in node _mul11 at 1-th input: expected (89,), got (89,10)
Error in symbol$infer.shape(list(...)) :
Error in operator _mul11: [18:18:32] d:\program files (x86)\jenkins\workspace\mxnet\mxnet\src\operator\tensor../elemwise_op_common.h:33: Check failed: assign(&dattr, (*vec)[i]) Incompatible attr in node _mul11 at 1-th input: expected (89,), got (89,10)

Minimum reproducible example

# This example is a multi-label regression on a generalized linear model with poisson likelihood
# we simulate random data
p = 32
n_label = 10
n = 89
X = matrix(runif(p*n,0,1),p,n)
y = matrix(round(rpois(n_label*n,10)),n_label,n)
# model building
data <- mx.symbol.Variable("data")
label=mx.symbol.Variable('label')
# we create a parametrized linear combination of input variables in fc
fc <- mx.symbol.FullyConnected(data, num_hidden=n_label,name="fc")
# As the loss, we write the Negative Log-Likelihood associated with an exponential link function
vecto.symb = mx.symbol.MakeLoss(data= mx.symbol.exp(fc) - label * fc , name="poisson")
devices = mx.gpu(0)
model = mx.model.FeedForward.create(symbol = vecto.symb,ctx = devices, X=X,y=y,num.round=5,array.layout="colmajor",learning.rate=0.01, optimizer="sgd",initializer=mx.init.normal(0.03),array.batch.size=20)
p = predict(model,X,array.layout="colmajor")

What have you tried to solve it?

The error appears when using the predict function. The same code works fine on another machine (same Windows 10, same R version) which has the classic cpu R install (used install.packages) of mxnet.

So the error might be an installation problem with the gpu version? or it might be related to #113 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions