bluemellophone commited on
Commit
cd605d0
·
unverified ·
1 Parent(s): 4d08020

Fix image

Browse files
.gitignore CHANGED
@@ -10,3 +10,4 @@ coverage/
10
 
11
  __pycache__/
12
  docs/build
 
 
10
 
11
  __pycache__/
12
  docs/build
13
+ models/
Dockerfile CHANGED
@@ -10,6 +10,7 @@ RUN set -ex \
10
  && apt-get update \
11
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12
  git \
 
13
  htop \
14
  && rm -rf /var/cache/apt \
15
  && rm -rf /var/lib/apt/lists/*
@@ -19,6 +20,8 @@ WORKDIR /code
19
  COPY ./ /code
20
 
21
  RUN conda install pip \
22
- && pip install --no-cache-dir -r requirements.txt
 
 
23
 
24
  CMD python app.py
 
10
  && apt-get update \
11
  && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
12
  git \
13
+ vim \
14
  htop \
15
  && rm -rf /var/cache/apt \
16
  && rm -rf /var/lib/apt/lists/*
 
20
  COPY ./ /code
21
 
22
  RUN conda install pip \
23
+ && pip install --no-cache-dir -r requirements.txt \
24
+ && pip install numpy --upgrade \
25
+ && conda install pytorch torchvision torchaudio cpuonly -c pytorch-nightly
26
 
27
  CMD python app.py
cv4e_lecture13/train.py CHANGED
@@ -9,7 +9,7 @@ import torch.nn as nn
9
  from torch.optim import Adam
10
  from tqdm import trange
11
 
12
- from . import dataset, model, utils
13
 
14
  log = None
15
 
 
9
  from torch.optim import Adam
10
  from tqdm import trange
11
 
12
+ from cv4e_lecture13 import dataset, model, utils
13
 
14
  log = None
15
 
cv4e_lecture13/utils.py CHANGED
@@ -81,7 +81,7 @@ def init_logging():
81
  def init_seed(seed):
82
  if seed is not None:
83
  random.seed(seed)
84
- # numpy.random.seed(seed) # we don't use NumPy in this code, but you would want to set its random number generator seed, too
85
  torch.manual_seed(seed)
86
  torch.cuda.manual_seed(seed)
87
  cudnn.benchmark = True
@@ -100,7 +100,7 @@ def init_config(config, log):
100
  if device not in ['cpu']:
101
  if torch.cuda.is_available():
102
  cfg['device'] = 'cuda'
103
- elif torch.backends.mps.is_available():
104
  cfg['device'] = 'mps'
105
  else:
106
  log.warning(
 
81
  def init_seed(seed):
82
  if seed is not None:
83
  random.seed(seed)
84
+ # numpy.random.seed(seed)
85
  torch.manual_seed(seed)
86
  torch.cuda.manual_seed(seed)
87
  cudnn.benchmark = True
 
100
  if device not in ['cpu']:
101
  if torch.cuda.is_available():
102
  cfg['device'] = 'cuda'
103
+ elif hasattr(torch.backends, 'mps') and torch.backends.mps.is_available():
104
  cfg['device'] = 'mps'
105
  else:
106
  log.warning(