AlexanderLutsenko / nobuco

Pytorch to Keras/Tensorflow/TFLite conversion made intuitive
MIT License
272 stars 17 forks source link

TypeError: converter_mean() got an unexpected keyword argument 'keepdims' #4

Closed hengck23 closed 1 year ago

hengck23 commented 1 year ago

This code has error

x = x.mean(0,keepdims=True)

  File "/home/titanx/hengck/opt/anaconda3.9/lib/python3.9/site-packages/nobuco/converters/node_converter.py", line 48, in decorator
    converter_result_func = converter_func(*args, **kwargs)
TypeError: converter_mean() got an unexpected keyword argument 'keepdims'

But i can get rid of it using: x = x.mean(0).unsqueeze(0)

AlexanderLutsenko commented 1 year ago

That's weird... The parameter's name is keepdim, but keepdims also works somehow. Anyways, below is the solution to your problem:

x = x.mean(0,keepdim=True)
hengck23 commented 1 year ago

it works. thanks!