'There is no checkpoint/model path. Use arg --cp-path to indicate the path!' ) if os.path.isfile(args.out_path): os.remove(args.out_path) print(args.out_path + ' Removed') if args.cuda: device = get_freer_gpu() if args.model_la == 'lstm': model_la = model_.cnn_lstm() elif args.model_la == 'resnet': model_la = model_.ResNet() elif args.model_la == 'resnet_pca': model_la = model_.ResNet_pca() elif args.model_la == 'lcnn_9': model_la = model_.lcnn_9layers() elif args.model_la == 'lcnn_29': model_la = model_.lcnn_29layers_v2() elif args.model_la == 'lcnn_9_pca': model_la = model_.lcnn_9layers_pca() elif args.model_la == 'lcnn_29_pca': model_la = model_.lcnn_29layers_v2_pca() elif args.model_la == 'lcnn_9_icqspec': model_la = model_.lcnn_9layers_icqspec() elif args.model_la == 'lcnn_9_prodspec': model_la = model_.lcnn_9layers_prodspec() elif args.model_la == 'lcnn_9_CC': model_la = model_.lcnn_9layers_CC(ncoef=args.ncoef_la) elif args.model_la == 'lcnn_29_CC':
max_nb_frames=args.n_frames, n_cycles=args.valid_n_cycles) valid_loader = torch.utils.data.DataLoader( valid_dataset, batch_size=args.valid_batch_size, shuffle=False, worker_init_fn=set_np_randomseed) else: valid_loader = None if args.model == 'lstm': model = model_.cnn_lstm(nclasses=args.n_classes) elif args.model == 'resnet': model = model_.ResNet(nclasses=args.n_classes) elif args.model == 'resnet_pca': model = model_.ResNet_pca(nclasses=args.n_classes) elif args.model == 'lcnn_9': model = model_.lcnn_9layers(nclasses=args.n_classes) elif args.model == 'lcnn_29': model = model_.lcnn_29layers_v2(nclasses=args.n_classes) elif args.model == 'lcnn_9_pca': model = model_.lcnn_9layers_pca(nclasses=args.n_classes) elif args.model == 'lcnn_29_pca': model = model_.lcnn_29layers_v2_pca(nclasses=args.n_classes) elif args.model == 'lcnn_9_icqspec': model = model_.lcnn_9layers_icqspec(nclasses=args.n_classes) elif args.model == 'lcnn_9_prodspec': model = model_.lcnn_9layers_prodspec(nclasses=args.n_classes) elif args.model == 'lcnn_9_CC': model = model_.lcnn_9layers_CC(nclasses=args.n_classes, ncoef=args.ncoef,
if os.path.isfile(args.out_path): os.remove(args.out_path) print(args.out_path + ' Removed') print('Cuda Mode is: {}'.format(args.cuda)) print('Selected model is: {}'.format(args.model)) if args.cuda: device = get_freer_gpu() if args.model == 'lstm': model = model_.cnn_lstm() elif args.model == 'resnet': model = model_.ResNet() elif args.model == 'resnet_pca': model = model_.ResNet_pca() elif args.model == 'lcnn_9': model = model_.lcnn_9layers() elif args.model == 'lcnn_29': model = model_.lcnn_29layers_v2() elif args.model == 'lcnn_9_pca': model = model_.lcnn_9layers_pca() elif args.model == 'lcnn_29_pca': model = model_.lcnn_29layers_v2_pca() elif args.model == 'lcnn_9_icqspec': model = model_.lcnn_9layers_icqspec() elif args.model == 'lcnn_9_prodspec': model = model_.lcnn_9layers_prodspec() elif args.model == 'lcnn_9_CC': model = model_.lcnn_9layers_CC(ncoef=args.ncoef, init_coef=args.init_coef)