Skip to content
Snippets Groups Projects
Commit b2c76861 authored by Maciej Wielgosz's avatar Maciej Wielgosz
Browse files

update to run on hpc machine

parent 0b2a41f3
No related branches found
No related tags found
No related merge requests found
......@@ -2,4 +2,5 @@
__pycache__/
modelnet40_normal_resampled/
outputs/
log/
\ No newline at end of file
log/
data/
\ No newline at end of file
batch_size: 16
epoch: 200
learning_rate: 1e-3
gpu: 1
gpu: 0
num_point: 1024
optimizer: Adam
weight_decay: 1e-4
......
......@@ -48,9 +48,14 @@ def main(args):
'''HYPER PARAMETER'''
os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu)
# print('GPU available: {}'.format(torch.cuda.is_available()))
logger = logging.getLogger(__name__)
print(args.pretty())
# print(args.pretty())
# use pretty print to print the config
root = hydra.utils.to_absolute_path('data/shapenetcore_partanno_segmentation_benchmark_v0_normal/')
......@@ -66,6 +71,9 @@ def main(args):
num_part = args.num_class
shutil.copy(hydra.utils.to_absolute_path('models/{}/model.py'.format(args.model.name)), '.')
# print if gpu is available
logger.info('GPU available: {}'.format(torch.cuda.is_available()))
classifier = getattr(importlib.import_module('models.{}.model'.format(args.model.name)), 'PointTransformerSeg')(args).cuda()
criterion = torch.nn.CrossEntropyLoss()
......@@ -202,7 +210,7 @@ def main(args):
mean_shape_ious = np.mean(list(shape_ious.values()))
test_metrics['accuracy'] = total_correct / float(total_seen)
test_metrics['class_avg_accuracy'] = np.mean(
np.array(total_correct_class) / np.array(total_seen_class, dtype=np.float))
np.array(total_correct_class) / np.array(total_seen_class, dtype=np.float32))
for cat in sorted(shape_ious.keys()):
logger.info('eval mIoU of %s %f' % (cat + ' ' * (14 - len(cat)), shape_ious[cat]))
test_metrics['class_avg_iou'] = mean_shape_ious
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment