Skip to content

Facing issue to execute. #1

Description

@arm235

CLASS_NAMES = np.array(['owl','galaxy', 'lightning','wine-bottle','t-shirt','waterfall', 'sword', 'school-bus',
'calculator','sheet-music','airplanes', 'lightbulb', 'skyscraper','mountain-bike','fireworks',
'computer-monitor','bear','grand-piano','kangaroo','laptop',], dtype='<U10')

import matplotlib.pyplot as plt

def show_batch(image_batch, label_batch):
plt.figure(figsize=(25,20))
for n in range(8):
ax = plt.subplot(1,8,n+1)
plt.imshow(image_batch[n])
plt.title(CLASS_NAMES[label_batch[n]==1][0].title())
plt.axis('off')

image_batch, label_batch = next(train_gen)
show_batch(image_batch, label_batch)


TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_21468/164695082.py in
13 plt.axis('off')
14
---> 15 image_batch, label_batch = next(train_gen)
16 show_batch(image_batch, label_batch)

c:\users\hp\anaconda3\envs\myenv\lib\site-packages\keras_preprocessing\image\iterator.py in next(self, *args, **kwargs)
102
103 def next(self, *args, **kwargs):
--> 104 return self.next(*args, **kwargs)
105
106 def next(self):

c:\users\hp\anaconda3\envs\myenv\lib\site-packages\keras_preprocessing\image\iterator.py in next(self)
114 # The transformation of images is not under thread lock
115 # so it can be done in parallel
--> 116 return self._get_batches_of_transformed_samples(index_array)
117
118 def _get_batches_of_transformed_samples(self, index_array):

c:\users\hp\anaconda3\envs\myenv\lib\site-packages\keras_preprocessing\image\iterator.py in _get_batches_of_transformed_samples(self, index_array)
229 target_size=self.target_size,
230 interpolation=self.interpolation)
--> 231 x = img_to_array(img, data_format=self.data_format)
232 # Pillow images should be closed after load_img,
233 # but not PIL images.

c:\users\hp\anaconda3\envs\myenv\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':

c:\users\hp\anaconda3\envs\myenv\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

ResNet152V2 Model

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions