Debugging tensorflow remotely

Debugging tensorflow remotely

When trying to work with Tensorflow, I was trying debugging it in a Linux (with a lot of memories) server but the command line is not easy to use and track the variable values. After searching in the web, I found out that PyCharm allows users to remotely debug a python script and most importantly, it is free :). Here are the steps that I used to debug a python script in a Linux server.

  • Install tensorflow in the Linux as in this link:
  • Make sure you can run an example of the python script. In my case, I am running the python script in this tutorial

~/tensorflow/tensorflow/models/rnn/ptb$ python –data_path=/home/hellovn/RNN/data/data/ –model small

  • Install PyCharm which is free if you are a University student and supports Windows and Mac OS X. Awesome 🙂
  • Copy the two egg files (i used a Windows machine to debug it) in C:\Program Files (x86)\JetBrains\PyCharm 2016.2.3\debug-eggs to the remote server.
  • Insert the scripts into your remote python script at the top:

import sys

import pydevd
pydevd.settrace(‘servername’, port=8080, suspend=False)

  • Open the port (8080 in my case) from the home router.
  • Start the debug server from your local computer. Here is an example of the Debug configuration. The local host name is the your home server URL. You can get familiar with setting up a home server in this link: (
  • tensor
  • Run the python script in your remote server.
  • The script will automatically connect to your home debugger server.



Leave a Reply

Your email address will not be published. Required fields are marked *