// in case network has reset_ctx to gpu
self._fake_x = mx.nd.zeros((1, 3, height, width))
net = copy.deepcopy(net)
net.collect_params().reset_ctx(None)
with autograd.train_mode():
_, self._anchors, self._offsets, self._feat_maps, _, _, _, _ = net(self._fake_x)
from ....model_zoo.yolo.yolo_target import YOLOV3PrefetchTargetGenerator
After Change
self._net_none = False
if net is None:
self._net_none = True
return
self._num_classes = len(net.classes)
self._kwargs = kwargs
// in case network has reset_ctx to gpu