Skip to content

VG captioning on saga: UFuncOutputCastingError #23

@elizlee

Description

@elizlee

Steps to reproduce:

  1. Log into a submit node
  2. Begin an interactive session
    srun --partition=gaia-lg --account=gaia-lg --qos=normal --gpus=4 --mem=30g --pty bash
  3. Use the following command to run the docker:
docker run -it --rm --gpus=4 -e VG_DATA_DIR=/input/data -v /nas/gaia02/data/paper2023/vg/visual_genome_python_driver:/input -v $OUTPUT_DIR:/output -e OUTPUT_FILE=/output/vg_all_output.tsv unified-io-inference:vg_caption_all_only

For me, this results in the following:

INFO:absl:Setting up model...
INFO:absl:Loading parameters...
INFO:absl:Model is ready
INFO:absl:Creating image to description mapping...
INFO:absl:Captioning images from /input/data...
Traceback (most recent call last):
  File "/root/./caption_vg.py", line 131, in <module>
    main()
  File "/root/./caption_vg.py", line 107, in main
    primary_output = model.vqa(image, CAPTIONING_PROMPT)
  File "/root/uio/runner.py", line 313, in vqa
    out = self.run([image], [question.lower()], output_text_len=32,
  File "/root/uio/runner.py", line 176, in run
    image, image_mask = utils.preprocess_image(
  File "/root/uio/utils.py", line 291, in preprocess_image
    input_image = normalize_image(input_image)
  File "/root/uio/utils.py", line 324, in normalize_image
    image -= BIAS.reshape((1, 1, 3))
numpy.core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'subtract' output from dtype('float64') to dtype('uint8') with casting rule 'same_kind'

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions