hub.load(model_handle) hangs on Colab
I'm trying too run the object detection example on colab https://colab.research.google.com/github/tensorflow/hub/blob/master/examples/colab/tf2_object_detection.ipynb It hangs on the cell
print('loading model...')
hub_model = hub.load(model_handle)
print('model loaded!')
These are the env vars and their values, in case that helps:
ENV /root/.bashrc
GCS_READ_CACHE_BLOCK_SIZE_MB 16
CLOUDSDK_CONFIG /content/.config
CUDA_VERSION 10.1.243
PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin
HOME /root
LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
LANG en_US.UTF-8
SHELL /bin/bash
LIBRARY_PATH /usr/local/cuda/lib64/stubs
CUDA_PKG_VERSION 10-1=10.1.243-1
SHLVL 1
GCE_METADATA_TIMEOUT 0
NCCL_VERSION 2.7.8
NVIDIA_VISIBLE_DEVICES all
TF_FORCE_GPU_ALLOW_GROWTH true
DEBIAN_FRONTEND noninteractive
CUDNN_VERSION 7.6.5.32
LAST_FORCED_REBUILD 20201027
JPY_PARENT_PID 49
PYTHONPATH /env/python
DATALAB_SETTINGS_OVERRIDES {"kernelManagerProxyPort":6000,"kernelManagerProxyHost":"172.28.0.3","jupyterArgs":["--ip=\"172.28.0.2\""]}
NO_GCE_CHECK True
GLIBCXX_FORCE_NEW 1
NVIDIA_DRIVER_CAPABILITIES compute,utility
_ /tools/node/bin/node
LD_PRELOAD /usr/lib/x86_64-linux-gnu/libtcmalloc.so.4
NVIDIA_REQUIRE_CUDA cuda>=10.1 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=418,driver<419
OLDPWD /
HOSTNAME 15e92c8a0f8d
COLAB_GPU 0
PWD /
CLOUDSDK_PYTHON python3
GLIBCPP_FORCE_NEW 1
PYTHONWARNINGS ignore:::pip._internal.cli.base_command
TBE_CREDS_ADDR 172.28.0.1:8008
TERM xterm-color
CLICOLOR 1
PAGER cat
GIT_PAGER cat
MPLBACKEND module://ipykernel.pylab.backend_inline
TF2_BEHAVIOR 1
KMP_DUPLICATE_LIB_OK True
KMP_INIT_AT_FORK FALSE
@karipulli,
I tried it and it didn't hang. But it took very long time (298 seconds). It may be because of the huge model size, which is approximately 700 MB. You can try changing the Runtime to either GPU or TPU and it will reduce the Model Loading time. Thanks!
This can be used to speed up model loading times in Colab:
import os
os.environ["TFHUB_MODEL_LOAD_FORMAT"] = "COMPRESSED"
We're looking at ways to improve load times so that this is not necessary