TorchNotes

[ Python延迟实例化 ]

Python 的类名可以作为参数直接传递,而不需要实例化,在使用该类对象之前对其进行实例化即可。

* use [ isinstance( object, classinfo) ] can detect whether the object is the instance of the classinfo.

[ Parameter and Hyperparameter ]

Parameter: the parameter inside the model, such as Weight, Bias .etc.

Hyperparameter: the parameter used to describe the model, is the configuration of network, such as the size of the input or output.

[ single-asterisk form of *args ]

def multiply(*args): z = 1 for num in args: z *= num print(z)

Convey an argument list to the funcion.

[ The launch command of the first model ]

CUDA_VISIBLE_DEVICES=2,3 \
python main.py \
ucf101 \
data/ucf101/ucf101_train_split1_list.txt \
data/ucf101/ucf101_val_split1_list.txt \
--arch resnet50_3d \
--dro 0.2 \
--mode 3D \
--t_length 16 \
--t_stride 4 \
--pretrained \
--epochs 95 \
--batch-size 64 \
--lr 0.001 \
--lr_steps 40 80 90 \
--workers 16 \
--image_tmpl img_{:05d}.jpg \

* Description: 1) 使用两块Titan x,因此batch-size改为16.     2)workers是数据加载的线程数,根据log中batch的数值,可以判断workers是否合理,合理的情况是内存不超并且batch=0,即批加载时间为0。

猜你喜欢

转载自www.cnblogs.com/hizhaolei/p/9911029.html