Closed fuyb1992 closed 2 years ago
Problem solved by change codes:
generate_scenes.py
room_mask = room_mask.to(device) # new add
bbox_params = network.generate_boxes(room_mask=room_mask, device=device) # change
boxes = dataset.post_process(bbox_params)
autoregressive_transformer.py
def generate_boxes(self, room_mask, max_boxes=32, device="cpu"):
boxes = self.start_symbol(device)
for i in range(max_boxes):
box = self.autoregressive_decode(boxes, room_mask=room_mask)
for k in box.keys():
boxes[k] = torch.cat([boxes[k], box[k]], dim=1)
# Check if we have the end symbol
if box["class_labels"][0, 0, -1] == 1:
break
return {
"class_labels": boxes["class_labels"].to('cpu'), # change
"translations": boxes["translations"].to('cpu'), # change
"sizes": boxes["sizes"].to('cpu'), # change
"angles": boxes["angles"].to('cpu') # change
}
Hi @fuyb1992,
I was only running the 'generate_boxes.py script on CPU, so thank you very much for pointing out this issue when running our code in GPU. Based on your suggestion, I just committed a small fix that should resolve this issue.
Best, Despoina
Your ideas about using transformers in this project is great, and I'm trying reproducing your project, but I got some obstacles. Atfter traning, I run the following code:
and get erros:
envs: cuda 10