Space is displaying infinitely loading while status is "Running"

Hello everyone!

I fixed all issues regarding to migrating code of my project to Hugging Face Spaces until the status changed to Running. But it is loading infinitely that does not allow to see the Gradio ui. Restarting this Space or Factory reboot this Space didn’t help. I can’t make this repo public because of privacy policy of my company, but here is screenshot and logfile.

2022-06-01 07:45:33.676322: I tensorflow/core/util/util.cc:169] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2022-06-01 07:45:33.867863: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory
2022-06-01 07:45:33.867898: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Removing cache dir /home/user/.cache/youtube-dl ..
backbone params inited by Pytorch official model
Downloading: "https://download.pytorch.org/models/resnet101-5d3b4d8f.pth" to /home/user/.cache/torch/hub/checkpoints/resnet101-5d3b4d8f.pth

  0%|          | 0.00/170M [00:00<?, ?B/s]
  5%|▍         | 8.16M/170M [00:00<00:01, 85.6MB/s]
 10%|β–‰         | 17.0M/170M [00:00<00:02, 53.8MB/s]
 13%|β–ˆβ–Ž        | 22.8M/170M [00:00<00:02, 54.6MB/s]
 17%|β–ˆβ–‹        | 28.3M/170M [00:00<00:02, 49.9MB/s]
 20%|β–ˆβ–‰        | 34.0M/170M [00:00<00:03, 41.2MB/s]
 22%|β–ˆβ–ˆβ–       | 38.2M/170M [00:00<00:03, 41.8MB/s]
 25%|β–ˆβ–ˆβ–Œ       | 42.7M/170M [00:00<00:03, 43.2MB/s]
 28%|β–ˆβ–ˆβ–Š       | 47.4M/170M [00:01<00:02, 44.8MB/s]
 30%|β–ˆβ–ˆβ–ˆ       | 51.9M/170M [00:01<00:03, 37.8MB/s]
 37%|β–ˆβ–ˆβ–ˆβ–‹      | 63.7M/170M [00:01<00:02, 54.8MB/s]
 41%|β–ˆβ–ˆβ–ˆβ–ˆ      | 69.1M/170M [00:01<00:02, 52.5MB/s]
 44%|β–ˆβ–ˆβ–ˆβ–ˆβ–Ž     | 74.2M/170M [00:01<00:02, 40.6MB/s]
 48%|β–ˆβ–ˆβ–ˆβ–ˆβ–Š     | 82.0M/170M [00:02<00:02, 34.5MB/s]
 53%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Ž    | 91.0M/170M [00:02<00:01, 43.6MB/s]
 56%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹    | 95.9M/170M [00:02<00:01, 42.8MB/s]
 59%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‰    | 101M/170M [00:02<00:01, 42.5MB/s] 
 64%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–   | 109M/170M [00:02<00:01, 38.2MB/s]
 69%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Š   | 117M/170M [00:02<00:01, 42.3MB/s]
 71%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ   | 121M/170M [00:03<00:01, 31.7MB/s]
 74%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–  | 127M/170M [00:03<00:01, 30.6MB/s]
 76%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹  | 130M/170M [00:03<00:01, 26.7MB/s]
 85%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ | 145M/170M [00:03<00:00, 44.7MB/s]
 95%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œ| 162M/170M [00:03<00:00, 66.7MB/s]
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 170M/170M [00:03<00:00, 46.6MB/s]
/home/user/.local/lib/python3.8/site-packages/gradio/deprecation.py:40: UserWarning: `optional` parameter is deprecated, and it has no effect
  warnings.warn(value)
/home/user/.local/lib/python3.8/site-packages/gradio/deprecation.py:40: UserWarning: `numeric` parameter is deprecated, and it has no effect
  warnings.warn(value)
/home/user/.local/lib/python3.8/site-packages/gradio/deprecation.py:40: UserWarning: The 'type' parameter has been deprecated. Use the Number component instead.
  warnings.warn(value)
Cache at /home/user/app/gradio_cached_examples/log.csv not found. Caching now in 'gradio_cached_examples/' directory.
2022-06-01 07:48:22.516779: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcuda.so.1'; dlerror: libcuda.so.1: cannot open shared object file: No such file or directory
2022-06-01 07:48:22.516813: W tensorflow/stream_executor/cuda/cuda_driver.cc:269] failed call to cuInit: UNKNOWN ERROR (303)
2022-06-01 07:48:22.516843: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:163] no NVIDIA GPU device is present: /dev/nvidia0 does not exist
2022-06-01 07:48:22.517784: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 AVX512F AVX512_VNNI FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
WARNING:tensorflow:From /home/user/.local/lib/python3.8/site-packages/tensorflow/python/util/deprecation.py:629: calling map_fn_v2 (from tensorflow.python.ops.map_fn) with dtype is deprecated and will be removed in a future version.
Instructions for updating:
Use fn_output_signature instead
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:140: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  new_dict[LABELS[key]] = np.float(result_dict[key])
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:213: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  conf = np.float(conf)
app.py:277: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  scores = [np.float(x) for x in logit[logit > 0.7].cpu().detach().numpy()]
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:140: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  new_dict[LABELS[key]] = np.float(result_dict[key])
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:213: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  conf = np.float(conf)
app.py:277: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  scores = [np.float(x) for x in logit[logit > 0.7].cpu().detach().numpy()]
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:140: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  new_dict[LABELS[key]] = np.float(result_dict[key])
WARNING:tensorflow:No training configuration found in the save file, so the model was *not* compiled. Compile it manually.
app.py:213: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  conf = np.float(conf)
app.py:277: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
  scores = [np.float(x) for x in logit[logit > 0.7].cpu().detach().numpy()]
Running on local URL:  http://localhost:7860/

To create a public link, set `share=True` in `launch()`.

Found solution. It was because of stacking several functions together. After UI update Gradio doesn’t accept something like

model_iface = gr.Interface(
    fn=[your_function_1, your_function_2],
    inputs=gr.inputs.Textbox(),
    outputs=gr.outputs.Label(num_top_classes=10),
    examples=[["first example"],
              ["second example"]]
)
model_iface.launch()

It should use gr.Parallel() instead. So the final code should be

model_1_iface = gr.Interface(
    fn=your_function_1,
    inputs=gr.inputs.Textbox(),
    outputs=gr.outputs.Label(num_top_classes=10)
)

model_2_iface = gr.Interface(
    fn= your_function_2,
    inputs=gr.inputs.Textbox(),
    outputs=gr.outputs.Label(num_top_classes=10),

)

combined_url_iface = gr.Parallel(model_1_iface, model_2_iface, 
                      examples=[["first example"],
                                ["second example"]])
combined_url_iface.launch()
1 Like