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

Improve error messages on shape inference (Operator) #12565

Closed
mdespriee opened this issue Sep 14, 2018 · 8 comments
Closed

Improve error messages on shape inference (Operator) #12565

mdespriee opened this issue Sep 14, 2018 · 8 comments
Labels
Backend Issues related to the backend of MXNet Operator

Comments

@mdespriee
Copy link
Contributor

Description

I'm trying to migrate to mxnet symbol a fairly complex flow, and I spent way too much time debugging "shape inference failed" errors when binding the module.
What shape ? What symbol ? Which shape is ok, and which is missing ? Argh !

Environment info (Required)

Using mxnet 1.3.0 on scala

Error Message:

java.lang.IllegalArgumentException: requirement failed: shape inference failed
	at scala.Predef$.require(Predef.scala:224)
	at org.apache.mxnet.module.DataParallelExecutorGroup.org$apache$mxnet$module$DataParallelExecutorGroup$$bindIthExec(DataParallelExecutorGroup.scala:635)
	at org.apache.mxnet.module.DataParallelExecutorGroup$$anonfun$bindExec$2.apply(DataParallelExecutorGroup.scala:378)
	at org.apache.mxnet.module.DataParallelExecutorGroup$$anonfun$bindExec$2.apply(DataParallelExecutorGroup.scala:377)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
	at scala.collection.immutable.Range.foreach(Range.scala:160)
	at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
	at scala.collection.AbstractTraversable.map(Traversable.scala:104)
	at org.apache.mxnet.module.DataParallelExecutorGroup.bindExec(DataParallelExecutorGroup.scala:377)
	at org.apache.mxnet.module.DataParallelExecutorGroup.<init>(DataParallelExecutorGroup.scala:322)
	at org.apache.mxnet.module.DataParallelExecutorGroup$Builder.build(DataParallelExecutorGroup.scala:223)
	at org.apache.mxnet.module.Module.bind(Module.scala:286)
@mdespriee
Copy link
Contributor Author

More generally, I also suggest to review the use of require() scattered in the code, and make sure they all have meaningful messages.

@kalyc
Copy link
Contributor

kalyc commented Sep 14, 2018

Thanks for submitting the issue @mdespriee, you can open a PR with the changes you have suggested and we can review them.
@mxnet-label-bot[Scala, Good First Issue]

@gigasquid
Copy link
Member

I agree. I've run into that one from the Clojure side as well and it could be improved.

@mdespriee
Copy link
Contributor Author

mdespriee commented Sep 15, 2018

After PR #12570 is merged, we'll go from this:

- failed inference *** FAILED ***
  java.lang.IllegalArgumentException: requirement failed: shape inference failed
  at scala.Predef$.require(Predef.scala:224)

to this:

- failed inference *** FAILED ***
  java.lang.IllegalArgumentException: requirement failed: Shape inference failed. 
Known shapes are Map(a -> (10,1,5)) for symbol arguments ArrayBuffer(a, constant) and aux states ArrayBuffer()

I think we can have even better from the backend, but that's progress.

@kalyc
Copy link
Contributor

kalyc commented Sep 20, 2018

@mdespriee thanks for your contribution. Looks like the PR has been merged. Can this issue be closed?

@mdespriee
Copy link
Contributor Author

mdespriee commented Sep 20, 2018 via email

@lanking520
Copy link
Member

@apeforest @anirudh2290 Do you have any plan for this?

@lanking520 lanking520 added Backend Issues related to the backend of MXNet and removed Scala labels Apr 8, 2019
@lanking520 lanking520 changed the title Improve error messages on shape inference (scala) Improve error messages on shape inference (Operator) Apr 8, 2019
@szha
Copy link
Member

szha commented Jul 29, 2020

The improvement would need to happen per operator. Let's create issues for individual operators when we discover more of these unclear messages.

@szha szha closed this as completed Jul 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Backend Issues related to the backend of MXNet Operator
Projects
None yet
Development

No branches or pull requests

6 participants