googletensorflow-serving

Connect to TensorFlow Serving from a different machine

For security reasons, the TensorFlow Serving port in this solution cannot be accessed over a public IP address. To connect to TensorFlow Serving from a different machine, you must either create an SSH tunnel, or open port 8500 for remote access. Refer to the FAQ for more information on creating an SSH tunnel or opening server ports.

IMPORTANT: Making this application’s network ports public is a significant security risk. You are strongly advised to only allow access to those ports from trusted networks. If, for development purposes, you need to access from outside of a trusted network, please do not allow access to those ports via a public IP address. Instead, use a secure channel such as a VPN or an SSH tunnel. Follow these instructions to remotely connect safely and reliably.

Once you have an active SSH tunnel or you opened the port for remote access, you can then connect to TensorFlow Serving using a ResNet client command like the one below. Replace SOURCE-PORT with the source port number specified in the SSH tunnel configuration, or 8500 if you opened the port for remote access, and HOST with 127.0.0.1 if you have an SSH tunnel or the host’s actual IP address otherwise.

$ resnet_client_cc --server_port=HOST:SOURCE-PORT --image_file=/tmp/example.jpg
Last modification December 21, 2022