首页 > 解决方案 > 尝试在 docker 中打开 *.hdf5 文件,但总是收到错误消息 = 'Is a directory'

问题描述

我有运行以下命令的脚本预测

# run predictions
DOCKER_RUN="docker run
  --entrypoint entrypoints/entrypoint.predict.cpu.sh \
  -v "$IMAGE_SOURCE":/src/$BASENAME_IS
  -v "$WEIGHTS_FILE":/weights.hdf5
  $DOCKER_IMAGE $BASE_MODEL_NAME /weights.hdf5 /src/$BASENAME_IS"

eval $DOCKER_RUN

我正在使用 Mac,当我尝试运行以下命令时:

/predict  --docker-image nima-cpu --base-model-name MobileNet --weights-file $(pwd)/models/MobileNet/weights_mobilenet_technical_0.11.hdf5 --image-source $(pwd)/src/tests/test_images/42039.jpg

我得到的输出

File "h5py/h5f.pyx", line 88, in h5py.h5f.open
OSError: Unable to open file (file read failed: time = Sun Oct 18 09:18:54 2020
, filename = '/weights.hdf5', file descriptor = 3, errno = 21, error message = 'Is a directory', buf = 0x7fff466d1fd0, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0)

但这是一个带有预测的文件。不是目录。请帮我解决问题。为什么我不能打开 weights.hdf5 文件?

标签: pythondocker

解决方案


推荐阅读