Tensorflow Allocation Memory: Allocation of 38535168 exceeds 10% of system memory

前端 未结 6 1195
盖世英雄少女心
盖世英雄少女心 2020-12-08 04:45

Using ResNet50 pre-trained Weights I am trying to build a classifier. The code base is fully implemented in Keras high-level Tensorflow API. The complete code is posted in t

6条回答
  •  时光取名叫无心
    2020-12-08 05:41

    Try reducing batch_size attribute to a small number(like 1,2 or 3). Example:

    train_generator = data_generator.flow_from_directory(
        'path_to_the_training_set',
        target_size = (IMG_SIZE,IMG_SIZE),
        batch_size = 2,
        class_mode = 'categorical'
        )
    

提交回复
热议问题