Unable to connect with Google Colab, Uplink disconnected Error

I have built an object detection system on Google Colab where I’m uploading images and getting an image with detected items.
I’m getting the following error

Error: anvil.server.UplinkDisconnectedError: The uplink server for “anvilup” has been disconnected at [Form1, line 15](javascript:void(0))

Google Colab: https://colab.research.google.com/drive/1tnM9WFBs_F9BeK3XwtQ4bHnC14qbzfYx?usp=sharing

Anvil App Code:

###appcode

from ._anvil_designer import Form1Template
from anvil import *
import anvil.server

class Form1(Form1Template):
 
  def __init__(self, **properties):
    # Set Form properties and Data Bindings.
    self.init_components(**properties)

    # Any code you write here will run when the form opens.

  def file_loader_1_change(self, file, **event_args):
    """This method is called when a new file is loaded into this FileLoader"""
    anvil.server.call("anvilup",file)
    self.image_1.source=file

###appcode

It sounds like your uplink is disconnected. Can you confirm that your notebook is connected and working?

Also if you surround your forum code in ticks (` or ```) it will be easier to read.

Hi! Thanks for the help
The app code on anvil is between the hashtags " ###appcode"
And the colab notebook link is attached
Yes the notebook is active but I’m not sure if it’s properly connected.
I followed the youtube tutorial and did exactly the same thing

Could you please check the code for anything that’s missing?
Thanks

A few things to try:

  1. Try to execute some server code from your Colab notebook. For example, checking a data table or searching for a user. This will let you know if it is connected.

  2. Ensure that the cell containing your function has been executed. Otherwise, the function will not be registered in your kernel and hence your app won’t see it.

  3. If you are working from the Dev version of your app use the dev uplink key. Otherwise, your uplink may only be looking at the published version of your app.