pytorch2keras
pytorch2keras copied to clipboard
ValueError: Layer weight shape (1, 512) not compatible with provided weight shape (2048, 512)
Thanx for your pytorch2keras. I dont know, maybe its not about convertation problem but maybe you have some advices to me. I did according to the example, like:
input_np = np.random.uniform(0, 1, (8, 3, 256, 128)) input_var = Variable(torch.FloatTensor(input_np))
but then im trying to compile it with shape like this:
k_model = pytorch_to_keras(net,input_var,[(3, 256, 128,)], verbose=True)
an error pops up:
DEBUG:onnx2keras:gemm:Input units 2048, output units 512.
Traceback (most recent call last): 'provided weight shape ' + str(w.shape))
ValueError: Layer weight shape (1, 512) not compatible with provided weight shape (2048, 512)
With shape like this:
k_model = pytorch_to_keras(net,dummy_input,[(3, None, None,)], verbose=True)
another error pops up:
DEBUG:onnx2keras:gemm:Input` units 2048, output units 512.
............................ return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Is there some problem with me? Thanx for advices
Environment (please complete the following information):
- OS: Ubuntu 18.0
- Python 3.7
Thanx for your pytorch2keras. I dont know, maybe its not about convertation problem but maybe you have some advices to me. I did according to the example, like: input_np = np.random.uniform(0, 1, (8, 3, 256, 128)) input_var = Variable(torch.FloatTensor(input_np)) but then im trying to compile it with shape like this: k_model = pytorch_to_keras(net,input_var,[(3, 256, 128,)], verbose=True) an error pops up:
DEBUG:onnx2keras:gemm:Input units 2048, output units 512.
Traceback (most recent call last): 'provided weight shape ' + str(w.shape)) ValueError: Layer weight shape (1, 512) not compatible with provided weight shape (2048, 512) With shape like this: k_model = pytorch_to_keras(net,dummy_input,[(3, None, None,)], verbose=True) another error pops up:
DEBUG:onnx2keras:gemm:Input` units 2048, output units 512.
............................ return ufunc.reduce(obj, axis, dtype, out, **passkwargs) TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType' Is there some problem with me? Thanx for advices Environment (please complete the following information):
OS: Ubuntu 18.0 Python 3.7
Has your problem been solved?
@poormag @tbbjymm21 were you able to resolve this issue?