Pycharm configure remote development and debugging remotely be tensorflow
After completion of each upload locally modify the code to the server, use the print center to monitor certain variables to debug it is too inconvenient, in order to facilitate remote debug, today pycharm configured to use a bit of remote functionality
After down when not matched find
tool
pycharm professional
Configure the server ssh service
File synchronization configuration
Open the panel
Tools -> Deployment -> Configuration
Click
+
No. create a new profile, enter the configuration nameName
, easily play,Type
selectSFTP
, and then click OK.Configure the server IP and port, authentication can choose a username and password, or use the private key file, putty also support the .ppk
Configure the root directory
Root Path
is the root directory of the project file on a remote server, the configuration according to demand, for example,/home/zhangsan/workplace
Path mapping
Mappings
,Local Path
set the project directory under Windows,Deployment path on server
set to the directory of the remote server, set up according to their needsExcluded Paths
Setting does not need to synchronize directories, such as configuration files, data set, the checkpoint and the like.Tools -> Deployment -> Options
TheCreate Empty directories
check mark, if the specified folder does not exist, will be created automatically.
Setting remote python interpreter
Menu bar
File -> Settings
, select enter the settings panelProject -> Project Interpreter
, then to the right, click the little gear set.Click
Add Remote
, chooseSSH Credentials
,Python interpreter path
choose the interpreter they need the remote server.When running the program, configuration
Run
time just select the configuration of the interpreter will be able to remotely debug, and with the use of a local interpreter is similar, but also need to set environment variables.Run -> Edit Configurations
In order to use the gpu tensorflow version, set the environment variable Environment variables
, can be set here cuda9.0 /usr/local/cuda-9.0/lib64
, similar needs of other environmental dependency for a method
If the execution .py
time of the need to pass command-line arguments, can Parameters
fill in (just write --arg=value
part), args string value of unquoted, plus the like will be considered part of the string, and this is directly in bash is not the same, no effect in bash quotes.
## file synchronization
tools -> Development -> Automatic Upload
Set up automatic synchronization
After modifying the remote file can also be found in the upper right corner of the Edit panel upload button, after you modify remote files can also find the upload button in the upper right corner to edit panel, easy to use, see Resources
Reference material