Пример #1
0
 def __init__(self, path, patches, rows, cols, transforms, begin, end):
     Process.__init__(self, name='SplitWorker')
     self.path = path
     self.patches = patches
     self.rows = rows
     self.cols = cols
     self.transforms = transforms
     self.begin = begin
     self.end = end
     #self.device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
     self.device = torch.device('cpu')
     self.extractor = models.resnet18(pretrained=True).to(self.device)
     self.extractor.fc = nn.Sequential()
     self.extractor.eval()
 def __init__(self, threadID, name, counter, env, experience_buffer,
              num_rollouts, initial_action, policy, features, device,
              downsample_image_size):
     Process.__init__(self)
     self.threadID = threadID
     self.name = name
     self.counter = counter
     self.env = env
     self.num_rollouts = num_rollouts
     self.buffer = []
     self.experience_buffer = experience_buffer
     self.downsample_image_size = downsample_image_size
     self.default_action = initial_action
     self.policy = policy.eval()
     self.features = features
     self.device = device