Я пытался использовать DeOldify, и я следую за шагами отсюда.
Руководство
У меня возникли две проблемы: я не могу найти настройки времени выполнения, и запуск from fasterai.visualize import *
приводит к следующей ошибке.
----------------------------------------------------------------------- ----
AssertionError Traceback (most recent call last)
<ipython-input-24-ec3d448c437f> in <module>
----> 1 from fasterai.visualize import *
~/DeOldify/fasterai/visualize.py in <module>
5 from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
6 from .filters import IFilter, MasterFilter, ColorizerFilter
----> 7 from .generators import gen_inference_deep, gen_inference_wide
8 from tensorboardX import SummaryWriter
9 from scipy import misc
~/DeOldify/fasterai/generators.py in <module>
14 return learn
15
---> 16 def gen_learner_wide(data:ImageDataBunch, gen_loss=FeatureLoss(), arch=models.resnet101, nf_factor:int=2)->Learner:
17 return unet_learner_wide(data, arch=arch, wd=1e-3, blur=True, norm_type=NormType.Spectral,
18 self_attention=True, y_range=(-3.,3.), loss_func=gen_loss, nf_factor=nf_factor)
~/DeOldify/fasterai/loss.py in __init__(self, layer_wgts)
10 super().__init__()
11
---> 12 self.m_feat = models.vgg16_bn(True).features.cuda().eval()
13 requires_grad(self.m_feat, False)
14 blocks = [i-1 for i,o in enumerate(children(self.m_feat)) if isinstance(o,nn.MaxPool2d)]
/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in cuda(self, device)
263 Module: self
264 """
--> 265 return self._apply(lambda t: t.cuda(device))
266
267 def cpu(self):
/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in _apply(self, fn)
191 def _apply(self, fn):
192 for module in self.children():
--> 193 module._apply(fn)
194
195 for param in self._parameters.values():
/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in _apply(self, fn)
197 # Tensors stored in modules are graph leaves, and we don't
198 # want to create copy nodes, so we have to unpack the data.
--> 199 param.data = fn(param.data)
200 if param._grad is not None:
201 param._grad.data = fn(param._grad.data)
/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in <lambda>(t)
263 Module: self
264 """
--> 265 return self._apply(lambda t: t.cuda(device))
266
267 def cpu(self):
/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py in _lazy_init()
160 raise RuntimeError(
161 "Cannot re-initialize CUDA in forked subprocess. " + msg)
--> 162 _check_driver()
163 torch._C._cuda_init()
164 _cudart = _load_cudart()
/anaconda3/lib/python3.7/site-packages/torch/cuda/__init__.py in _check_driver()
73 def _check_driver():
74 if not hasattr(torch._C, '_cuda_isDriverSufficient'):
---> 75 raise AssertionError("Torch not compiled with CUDA enabled")
76 if not torch._C._cuda_isDriverSufficient():
77 if torch._C._cuda_getDriverVersion() == 0:
AssertionError: Torch not compiled with CUDA enabled