-
Notifications
You must be signed in to change notification settings - Fork 0
Tips
Henson edited this page Jan 3, 2020
·
30 revisions
- Debugging and Visualisation in PyTorch using Hooks
- visualising-cnn-models-using-pytorch
- pytorch-cnn-visualizations
- Better Comments
- vscode-icons
- kite | TabNine
- black
- Linting
- Code Runner | Output Colorizer
- vscode-fileheader
- Auto Import
- GitLens
- RemoteHub
- Rainbow Brackets
- indent-rainbow
- bash Anaconda3-2019.03-Linux-x86_64.sh -u
- sudo mount -t nfs 10.180.2.101:/data0 /data0
- history | grep mount
- ps aux | grep mount
- sudo fuser -v /dev/nvidia*
- sudo chgrp -R ahs data
- sudo chown -R ahs data
- tmux new -s zhangcc
- tmux a -t zhangcc
- (tmux)[http://louiszhai.github.io/2017/09/30/tmux/#新建会话]
nvidia-docker run -it \
-p 16006:6006 \
-p 10241:10241 \
-p 10243:10243 \
-p 10244:10244 \
-p 10242:22 \
--name=zhangcc \
--shm-size=64G \
--privileged=true \
-v /data/zhangcc/:/data/zhangcc/ \
-v /data0/datasets/:/data0/datasets/ \
-v /data0/zhangcc/:/data0/zhangcc/ \
zccyman/deepframe:stable /bin/bash
nvidia-docker run -it \
-p 16006:6006 \
-p 10221:10221 \
-p 10223:10223 \
-p 10224:10224 \
-p 10222:22 \
--name=Henson \
--shm-size=64G \
--privileged=true \
-v /home/aihuishou/zhangcc/:/home/aihuishou/zhangcc/ \
-v /home/sda/ftp/pub/aihuishou/files/:/home/sda/ftp/pub/aihuishou/files/ \
zccyman/pytorch:base /bin/bash
apt update
apt install openssh-server
mkdir /var/run/sshd
echo 'root:passwd' | chpasswd
sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
echo "export VISIBLE=now" >> /etc/profile
vim /etc/ssh/sshd_config,添加:PermitRootLogin yes
cd /root
mkdir .ssh
vim authorized_keys #copy windows id_rsa.pub
service ssh restart
- @staticmethod 静态方法无需实例化, 也可以实例化后调用
- @property 负责把一个方法变成属性调用的
class Student(object):
@property
def score(self):
return self._score
@score.setter
def score(self, value):
self._score = value
>>> s = Student()
>>> s.score = 60 # OK,实际转化为s.set_score(60)
>>> s.score # OK,实际转化为s.get_score()
60
- meshgrid
grid_x = grid_x_tmp = (torch.arange(0, width) + 1).unsqueeze(dim=0)
for i in range(1, height):
grid_x = torch.cat([grid_x, grid_x_tmp], dim=0)
grid_x = grid_x.expand_as(refine_out).cuda(
device=torch.cuda.current_device()).float()
grid_y = grid_y_tmp = (torch.arange(0, height) + 1).unsqueeze(dim=1)
for i in range(1, width):
grid_y = torch.cat([grid_y, grid_y_tmp], dim=1)
grid_y = grid_y.expand_as(refine_out).cuda(
device=torch.cuda.current_device()).float()
grid_x, grid_y = torch.meshgrid(
[torch.arange(0, height) + 1, torch.arange(0, width) + 1])
grid_x = grid_x.expand_as(refine_out).cuda(
device=torch.cuda.current_device()).float()
grid_y = grid_y.expand_as(refine_out).cuda(
device=torch.cuda.current_device()).float()