From 2daa24dd6e5d84d2283275d4b5fac4b0961f1ca6 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Wed, 13 Jan 2021 13:15:12 +0800 Subject: Add server startup script --- startup | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 startup diff --git a/startup b/startup new file mode 100644 index 0000000..b2a9dca --- /dev/null +++ b/startup @@ -0,0 +1,19 @@ +#!/bin/bash + +snap remove lxd +snap remove core18 +apt -y purge snapd gdm3 +apt -y autoremove + +apt update +apt -y install python3-pip python-is-python3 nvtop zstd rclone + +pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html +pip3 install scikit-learn tqdm tensorborad + +git clone https://git.jordangong.com/jordangong/gait-recognition.git +cd gait-recognition; git checkout python3.8; cd .. +mkdir -p gait-recognition/data/CASIA-B-MRCNN +wget https://storage.googleapis.com/gait-dataset/CASIA-B-MRCNN-SEG.tar.zst +tar -I zstd -xf CASIA-B-MRCNN-SEG.tar.zst -C gait-recognition/data/CASIA-B-MRCNN +mv gait-recognition/data/CASIA-B-MRCNN/{CASIA-B-MRCNN-SEG,SEG} -- cgit v1.2.3 From ad5211cce95ed8756b7960527813e93847df6f82 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Wed, 13 Jan 2021 13:31:44 +0800 Subject: Tensorboard typo fix --- startup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/startup b/startup index b2a9dca..a7253dd 100644 --- a/startup +++ b/startup @@ -9,7 +9,7 @@ apt update apt -y install python3-pip python-is-python3 nvtop zstd rclone pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html -pip3 install scikit-learn tqdm tensorborad +pip3 install scikit-learn tqdm tensorboard git clone https://git.jordangong.com/jordangong/gait-recognition.git cd gait-recognition; git checkout python3.8; cd .. -- cgit v1.2.3 From db5a58b1db9875afbc2a4c7e6e5d190b6c28ee34 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Thu, 14 Jan 2021 16:50:23 +0800 Subject: Remove DataParallel --- models/model.py | 11 ++--------- startup | 9 ++++++--- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/models/model.py b/models/model.py index c6a1234..740cdf3 100644 --- a/models/model.py +++ b/models/model.py @@ -137,7 +137,7 @@ class Model: sched_hp = self.hp.get('scheduler', {}) self.rgb_pn = RGBPartNet(self.train_size, self.in_channels, **model_hp) # Try to accelerate computation using CUDA or others - self.rgb_pn = self._accelerate(self.rgb_pn) + self.rgb_pn = self.rgb_pn.to(self.device) self.optimizer = optim.Adam(self.rgb_pn.parameters(), **optim_hp) self.scheduler = optim.lr_scheduler.StepLR(self.optimizer, **sched_hp) self.writer = SummaryWriter(self._log_name) @@ -196,13 +196,6 @@ class Model: self.writer.close() break - def _accelerate(self, model: nn.Module) -> nn.Module: - if not self.disable_acc: - if torch.cuda.device_count() > 1: - model = nn.DataParallel(model) - model = model.to(self.device) - return model - def predict_all( self, iter_: int, @@ -225,7 +218,7 @@ class Model: model_hp = self.hp.get('model', {}) self.rgb_pn = RGBPartNet(ae_in_channels=self.in_channels, **model_hp) # Try to accelerate computation using CUDA or others - self.rgb_pn = self._accelerate(self.rgb_pn) + self.rgb_pn = self.rgb_pn.to(self.device) self.rgb_pn.eval() gallery_samples, probe_samples = [], {} diff --git a/startup b/startup index a7253dd..644e59b 100644 --- a/startup +++ b/startup @@ -2,17 +2,20 @@ snap remove lxd snap remove core18 -apt -y purge snapd gdm3 +apt -y purge snapd gdm3 colord accountsservice rsyslog switcheroo-control \ + network-manager multipath-tools modemmanager upower rtkit policykit-1 apt -y autoremove apt update apt -y install python3-pip python-is-python3 nvtop zstd rclone -pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 -f https://download.pytorch.org/whl/torch_stable.html +pip3 install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio===0.7.2 \ + -f https://download.pytorch.org/whl/torch_stable.html pip3 install scikit-learn tqdm tensorboard +cd /root + git clone https://git.jordangong.com/jordangong/gait-recognition.git -cd gait-recognition; git checkout python3.8; cd .. mkdir -p gait-recognition/data/CASIA-B-MRCNN wget https://storage.googleapis.com/gait-dataset/CASIA-B-MRCNN-SEG.tar.zst tar -I zstd -xf CASIA-B-MRCNN-SEG.tar.zst -C gait-recognition/data/CASIA-B-MRCNN -- cgit v1.2.3