I'm trying to access Tensorboard on AWS. Here is my setting :
- Tensorboard :
tensorboard --host 0.0.0.0 --logdir=train
:
Starting TensorBoard b'39' on port 6006 (You can navigate to http://172.31.18.170:6006)
- AWS Security groups (in):
- HTTPS TCP 443 0.0.0.0/0
- Custom_TCP TCP 6006 0.0.0.0/0
However connecting to ec2-blabla.us-west-1.compute.amazonaws.com:6006
I can't see anything, I basically can't connect.
Do you have any idea?
You can use ssh tunneling technique.
In your terminal you can write:
ssh -i /path/to/your/AWS/key/file -NL 6006:localhost:6006 user@host
where user and host are your aws ec2 user and instance specific.
After that you can browse to http://localhost:6006/
Run tensorboard in your ec2 terminal (you can custom logdir and port)
tensorboard --logdir=data/model --port=8080
Find your workstations public ip (a.b.c.d) address by visiting
http://ip4.me/
Access the security group configuration assigned to your EC2 and add a custom TCP rule to your inbound traffic.
Outbound should be set to allow traffic from tensorboard port. (In this case 8080). Or you just allow all outgoing traffic from your EC2 instance
Protocol Port Range Destination Description All traffic All All 0.0.0.0/0
Use your public DNS to access tensorboard from your workstation
Fast (but unsecure) solution:
Run:
tensorboard --logdir=/training --host=0.0.0.0 --port=8080
on your AWS instance.
Make sure that both your inbound and outbound rules on AWS console (control center) are as unrestricted as possible (allow all types, all ports etc.). However, keep in mind that this solution is not recommendable for environments requiring security (in our case, we didn't consider security for training an NN).
An attempt to explain why this works: when the policy is set as described, AWS still seems to prohibit inbound/outbound connections on the standard tensorboard port 6006. This does not seem to apply to the port 8080.
Long (but more secure) solution: See: https://blog.altoros.com/getting-started-with-a-cpu-enabled-tensorflow-instance-on-aws.html (provides explanations for setting ports correctly on AWS)
I managed to set it up like this:
- Go to security groups in your ec2 console:

Choose the relevant security group in the table, click edit.
Add a rule like this:

Start tensorboard:
tensorboard --logdir tf_summary/ --port 8080
Find out the URL of your instance and visit
http://yourURL:8080
Simply run the tensorboard without the host parameter (which poses restrictions)
tensorboard --logdir XXX --port 6006
I suffered from the same problem for several days.
Fortunately I solved this issue by adding rule on "AWS Outbound rule" as if I had added "AWS Inbound rule".
Regardless of this setting, it works at home. The same error is still happening only in the company.
来源:https://stackoverflow.com/questions/42277280/accessing-tensorboard-on-aws