Skip to content

ValueError: could not broadcast input array #16

@emilaz

Description

@emilaz

Hey,
I'm trying to run your wrapper on a batch of the Imagenet Dataset. However, I'm getting the following error:

################################################################################
Batch Size: 64
Number of Examples: 857
Number of Batches: 14
Extracting features for layer 'resnet_v2_101/logits' with shape [896, 1, 1, 1001]
################################################################################
Traceback (most recent call last):
  File "example_feat_extract.py", line 152, in <module>
    args.batch_size, args.num_classes)
  File "example_feat_extract.py", line 86, in feature_extraction_queue
    feature_dataset[layer_name][start:end] = outputs[layer_name]
ValueError: could not broadcast input array from shape (3,1,1,1001) into shape (64,1,1,1001)

I ran
python example_feat_extract.py --network resnet_v2_101 --checkpoint ../checkpoints/resnet_v2_101.ckpt --image_path ../images/curr_batch/ --out_file ../features/features.h5 --layer_names resnet_v2_101/logits --preproc_func inception

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