Open AndreGuerra123 opened 6 years ago
mx.model.FeedForward.create
is a function intended for training of the model, it is therefore expected to have a label passed as the y
argument.
Your model should have a loss function for in order to train; for example, mx.symbol.LinearRegressionOutput
. Please take a look at this MNIST tutorial for example: http://mxnet.incubator.apache.org/tutorials/r/mnistCompetition.html.
You need to be aware of the the data dimensions through the model: if 126 samples in X, Y should also be of length 126. Check the model arhcitecture used: a FC on images (which should normally be of equal WH dimensions) is likely not what is needed (check for convolution layers). And if performing a 2 class classification, then needs a final FC with num_hidden = 2 followed by a softmaxoutput or rather a FC of size 1 followed by a LogisticLinearOutput.
The number of observations is the same. (Edited above) What do you mean as a label passed as the y argument? I have a vector of the type factor with the labels "I","II","III", etc... Could you please look into the dataset I shared?
@mxnet-label-bot add [R]
Note: Providing complete information in the most concise form is the best way to get help. This issue template serves as the checklist for essential information to most of the technical issues and bug reports. For non-technical issues and feature requests, feel free to present the information in what you believe is the best form.
For Q & A and discussion, please start a discussion thread at https://discuss.mxnet.io
Description
Failed to get some dimension properties from a multidimensional array in R, right in the beginning of the feedforward.create function.
Environment info (Required)
Package used (Python/R/Scala/Julia): (I'm using R) For R user, please provide R
sessionInfo()
: R version 3.4.1 (2017-06-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1Matrix products: default
locale: [1] LC_COLLATE=English_United Kingdom.1252 [2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 [4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages: [1] stats graphics grDevices utils datasets [6] methods base
other attached packages: [1] mxnet_0.10.1 RMySQL_0.10.13 DBI_0.7
loaded via a namespace (and not attached): [1] Rcpp_0.12.12 pillar_1.1.0
[3] compiler_3.4.1 RColorBrewer_1.1-2 [5] influenceR_0.1.0 plyr_1.8.4
[7] bindr_0.1 viridis_0.4.0
[9] tools_3.4.1 digest_0.6.12
[11] jsonlite_1.5 viridisLite_0.2.0 [13] tibble_1.4.1 gtable_0.2.0
[15] rgexf_0.15.3 pkgconfig_2.0.1
[17] rlang_0.1.2 igraph_1.1.2
[19] rstudioapi_0.7 yaml_2.1.14
[21] bindrcpp_0.2 gridExtra_2.3
[23] downloader_0.4 DiagrammeR_0.9.2
[25] dplyr_0.7.3 stringr_1.2.0
[27] htmlwidgets_0.9 hms_0.3
[29] grid_3.4.1 glue_1.1.1
[31] R6_2.2.2 Rook_1.1-1
[33] XML_3.98-1.9 readr_1.1.1
[35] purrr_0.2.3 tidyr_0.7.2
[37] ggplot2_2.2.1 magrittr_1.5
[39] codetools_0.2-15 scales_0.5.0
[41] htmltools_0.3.6 assertthat_0.2.0
[43] colorspace_1.3-2 brew_1.0-6
[45] stringi_1.1.5 visNetwork_2.0.1
[47] lazyeval_0.2.0 munsell_0.4.3
Error Message:
Error in output.shape[[output.names]] <- dim((X$value())$label) : attempt to select less than one element in OneIndex
Minimum reproducible example
(If you are using your own code, please provide a short script that reproduces the error. Otherwise, please provide link to the existing example.)
Steps to reproduce
x is Large array (492 426 3 * 126) - width, height,channel, samples/ y is factor vector of size 126;
What have you tried to solve it?