Home > other >  Python juypter undefined name XXX mistakes
Python juypter undefined name XXX mistakes

Time:09-27

Ls=[random randint (0, len (y_train)) for I in range (20)]
Visualize_random_images (list_imgs=ls, X_dataset=X_train, y_dataset=y_train)

Print (' * * * Train dataset after augmentation ')
Print (' \ t Total Number of images in Train dataset: {} '. The format (X_train. Shape [0]))

PLT. Bar (np) arange (n_classes), get_count_imgs_per_class (y_train), the align="center")
PLT. Xlabel (' class ')
PLT. Ylabel (' Frequency ')
PLT. Xlim (lancet] [- 1)
PLT. The show ()

Print (' * * * the Validation dataset ')
PLT. Bar (np) arange (n_classes), get_count_imgs_per_class (y_validation), the align="center")
PLT. Xlabel (' class ')
PLT. Ylabel (' Frequency ')
PLT. Xlim (lancet] [- 1)
PLT. The show ()

Error:
NameError: name 'y_train' is not defined

CodePudding user response:

Bosses how to solve excuse me

CodePudding user response:

reference 1st floor qq_42654692 response:
could you tell me how to solve ah bosses the

Y_train your variable is not defined, it is necessary to define y_train,

CodePudding user response:

What is the value of your 'y_train'? Is the current file is defined? Documents of import come in?
  • Related