AssertionError: HybridBlock requires the first argument to forward be either Symbol or NDArray, but
2018-03-16 16:02
961 查看
mxnet中的HybridBlock只接受Symbol和NDArray数据,如果你送入的是numpy.ndarray或者list数据,就会报如上的错误。
解决办法:把数据变为NDArray就行了。
解决办法:把数据变为NDArray就行了。
>>> import mxnet as mx >>> import numpy as np >>> data = np.arange(5) >>> b = mx.nd.array(data) # 转换方法 >>> b [ 0. 1. 2. 3. 4.] <NDArray 5 @cpu(0)>
相关文章推荐
- Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in
- vs2005下出现“Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive”的解决方法
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- 【Qt开发】 QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory
- 异常:Error: Aesthetics must either be length one, or the same length as the dataProblems:AData
- QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory
- 解决 Android Nougat requires the IDE to be running with Java 1.8 or later Install a supported JDK
- Hi there,Error:The absolute uri: http://java.sun.com/jsp/jstl/sql cannot be resolved in either web.xml or the jar files deployed
- The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid
- The log or differential backup cannot be restored because no files are ready to rollforward.
- [ERROR] The goal you specified requires a project to execute but there is no POM in this directory
- Unable to determine the principal end of an association between the types '***. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
- R12 - Error 'Unable to process your transaction. The operating unit is either invalid or it cannot b
- Git出现error: Your local changes to the following files would be overwritten by merge: ... Please, commit your changes or stash them before you can merge.的问题解决(Git代码冲突)
- System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list
- Android Stdio 中的Rendering Problems Android N requires the IDE to be running with Java 1.8 or later Install a supported JDK解决办法
- 搞定Android null requires the IDE to be running with Java 1.8 or later
- Fatal Error: ezSQL_mysql requires mySQL Lib to be compiled and or linked in to the PHP engine
- 奇葩问题:This file could not be checked in because the original version of the file on the server was moved or deleted. A new version of this file has been saved to the server, but your check-in comments were not saved
- Namespace declaration statement has to be the very first statement or after any declare call in the script