File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ It includes:
25
25
Install dependencies:
26
26
27
27
``` bash
28
- pip install torch torchvision
28
+ pip install -r requirements.txt
29
29
```
30
30
31
31
---
@@ -43,7 +43,7 @@ python swin_transformer.py --epochs 10 --batch-size 64 --lr 0.001
43
43
Testing is done automatically after each epoch. To only test, run with:
44
44
45
45
``` bash
46
- python swin_transformer.py --epochs 0
46
+ python swin_transformer.py --epochs 1
47
47
```
48
48
49
49
### Save the model
Original file line number Diff line number Diff line change @@ -172,9 +172,10 @@ def main():
172
172
parser .add_argument ('--save-model' , action = 'store_true' )
173
173
args = parser .parse_args ()
174
174
175
- use_cuda = torch .cuda .is_available ()
176
- device = torch .device ("cuda" if use_cuda else "cpu" )
177
-
175
+ use_accel = torch .accelerator .is_available ()
176
+ device = torch .accelerator .current_accelerator () if use_accel else torch .device ("cpu" )
177
+ print (f"Using device: { device } " )
178
+
178
179
torch .manual_seed (args .seed )
179
180
180
181
transform = transforms .Compose ([
You can’t perform that action at this time.
0 commit comments