Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flower Training Notebooks Error #144

Closed
raymondlo84 opened this issue Jul 2, 2021 · 2 comments · Fixed by #145
Closed

Flower Training Notebooks Error #144

raymondlo84 opened this issue Jul 2, 2021 · 2 comments · Fixed by #145

Comments

@raymondlo84
Copy link
Collaborator

I got this error when I run the training notebooks and somehow this line is returning error. I'm on Windows 11, Python 3.7, and just did the installation fresh.

img_array = keras.preprocessing.image.img_to_array(img)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-32-e39202bdee35> in <module>
      6 )
      7 print(img)
----> 8 img_array = keras.preprocessing.image.img_to_array(img)
      9 img_array = tf.expand_dims(img_array, 0) # Create a batch
     10 

~\Documents\openvino_env\lib\site-packages\tensorflow\python\keras\preprocessing\image.py in img_to_array(img, data_format, dtype)
    226       dtype = backend.floatx()
    227     kwargs['dtype'] = dtype
--> 228   return image.img_to_array(img, data_format=data_format, **kwargs)
    229 
    230 

~\Documents\openvino_env\lib\site-packages\keras_preprocessing\image\utils.py in img_to_array(img, data_format, dtype)
    307     # or (channel, height, width)
    308     # but original PIL image has format (width, height, channel)
--> 309     x = np.asarray(img, dtype=dtype)
    310     if len(x.shape) == 3:
    311         if data_format == 'channels_first':

~\Documents\openvino_env\lib\site-packages\numpy\core\_asarray.py in asarray(a, dtype, order)
     81 
     82     """
---> 83     return array(a, dtype, copy=False, order=order)
     84 
     85 

TypeError: __array__() takes 1 positional argument but 2 were given
@raymondlo84
Copy link
Collaborator Author

I then skipped that step and finish the model optimizer and got my xml and bin.

@raymondlo84
Copy link
Collaborator Author

I think it maybe the Keras nightly got a new bug? :\

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant