'During tesing my model TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

During tesing my model on gender classification, the error comes: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

    if not FLAGS.multi_crop:
        image = cv2.resize(image, (FLAGS.input_size, FLAGS.input_size))
        image = np.expand_dims(image, axis=0)
        result = sess.run(predict_label, feed_dict={image_batch: image,
                                                    label_batch: None,
                                                    training_or_not: False})

        label = np.argmax(result, axis=1)

error:

 File "C:/Users/x/Desktop/毕设/rude-carnie-master/rude-carnie-master/train1.py", line 443, in main
    inference(image)

  File "C:/Users/x/Desktop/毕设/rude-carnie-master/rude-carnie-master/train1.py", line 426, in inference
    training_or_not: False})

  File "D:\software\Python\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\client\session.py", line 905, in run
    run_metadata_ptr)

  File "D:\software\Python\Anaconda3\envs\tensorflow1\lib\site-packages\tensorflow\python\client\session.py", line 1109, in _run
    np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)

  File "D:\software\Python\Anaconda3\envs\tensorflow1\lib\site-packages\numpy\core\_asarray.py", line 85, in asarray
    return array(a, dtype, copy=False, order=order)

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source