[英]How can I fix dimension i got the same error even i edit dtype with int32 or float32?
How can I fix this problem please?请问我该如何解决这个问题?
dtype_attr = getattr(initializer, 'dtype', None)
if dtype is not None and dtype_attr is not None \
and numpy.dtype(dtype) != numpy.dtype(dtype_attr):
raise ValueError(
'dtype mismatch: {} != {}'.format(dtype, dtype_attr))
if dtype is None:
dtype = dtype_attr
dtype = chainer.get_dtype(dtype)
array = xp.empty(shape, dtype=dtype)
initializer(array)
return array
Error:错误:
File "/usr/local/lib/python3.6/dist-packages/chainer/initializers/ init .py", line 50, in generate_array array = xp.empty(shape, dtype=dtype) ValueError: sequence too large;
文件“/usr/local/lib/python3.6/dist-packages/chainer/initializers/init .py”,第 50 行,在 generate_array 数组 = xp.empty (shape, dtype=dtype) ValueError: sequence too large; cannot be greater than 32
不能大于 32
"sequence too large error means that you are creating a multidimension array that has a dimension larger than 32. For example: np.empty([1]*33) will raise this error." “序列太大错误意味着您正在创建一个维度大于 32 的多维数组。例如:np.empty([1]*33) 将引发此错误。” as explained by the user HYRT here: Numpy array: sequence too large
正如用户HYRT所解释的那样: Numpy 数组:序列太大
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.