a
    Tqe                      @   s4   d Z ddlZddlZddlZddlmZ dd ZdS )a[  
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Author: Nguyen Mau Dung
# DoC: 2020.08.17
# email: nguyenmaudung93.kstn@gmail.com
-----------------------------------------------------------------------------------
# Description: The configurations of the project will be defined here
    N)EasyDictc                  C   s  t jdd} | jdtddd | jdtdd	d
d | jdtdddd | jdtdddd | jdtd ddd | jdtddd | jdddd | jdtd dd | jdtdd d | jd!td"d#d | jd$td%d&d'd | jd(td%d&d)d | jd*td+d&d,d | jd-td.d&d/d | jd0td1d&d2d | jd3td4d5d | jd6td7d8d9d | jd:td;d<d=d | jd>td?d@dAd | jdBdCtdDdEdFd | jdGtdHdIdJd | jdKdLdMdNgdOdP | jdQdRtd&dSdT | jdUdRtd&dVdT | jdWdXtdYdZ | jd[d\td]dZ | jd^d td_dZ | jd`ddad | jdbddcd | jdddded | jdftd ddgd | jdhtd%did tt|  }t	
|jrdjndk|_
t	j |_dl|_dm|_dn|_d|_d%|_dl|_do|_dp|_d+|_d.|_dp|_d+|_|j|j|j|j|jdq|_d|_tj|j drds|_!tj|j dt|j"|_#tj|j du|j"|_$tj%|j#sft&|j# tj%|j$st&|j$ |S )vNz The Implementation using PyTorch)descriptionz--seedi  z're-produce the results with seed random)typedefaulthelpz
--saved_fnZfpn_resnet_18ZFNz*The name using for saving logs, models,...)r   r   metavarr   z
--root-dirz../PATHzThe ROOT working directoryz--archARCHz"The name of the model architecturez--pretrained_pathz%the path of the pretrained checkpointz--hflip_probg      ?z"The probability of horizontal flipz--no-val
store_truez/If true, dont evaluate the model on the val set)actionr   z--num_samplesz-Take a subset of the dataset to run and debugz--num_workers   z"Number of threads for loading dataz--batch_size   zmini-batch size (default: 16), this is the totalbatch size of all GPUs on the current node when usingData Parallel or Distributed Data Parallelz--print_freq2   Nzprint frequency (default: 50)z--tensorboard_freqz-frequency of saving tensorboard (default: 50)z--checkpoint_freq   z,frequency of saving checkpoints (default: 5)z--start_epoch   zthe starting epochz--num_epochsi,  znumber of total epochs to runz	--lr_typecosinzFthe type of learning rate scheduler (cosin or multi_step or one_cycle)z--lrgMbP?LRzinitial learning ratez--minimum_lrgHz>ZMIN_LRz%minimum learning rate during trainingz
--momentumg|?5^?Mmomentumz-wdz--weight_decayg        ZWDzweight decay (default: 0.)z--optimizer_typeadamZ	OPTIMIZERz,the type of optimizer, it can be sgd or adamz--steps*      znumber of burn in step)nargsr   r   z--world-sizez(number of nodes for distributed training)r   r   r   r   z--rankz"node rank for distributed trainingz
--dist-urlztcp://127.0.0.1:29500z'url used to set up distributed training)r   r   r   z--dist-backendncclzdistributed backendz	--gpu_idxzGPU index to use.z	--no_cudazIf true, cuda is not used.z--multiprocessing-distributedzUse multi-processing distributed training to launch N processes per node, which has N GPUs. This is the fastest way to use PyTorch for either single node or multi node data parallel trainingz
--evaluatez%only evaluate the model, not trainingz--resume_pathz"the path of the resumed checkpointz--Kzthe number of top KcpucudaT)`  r   )   r    @      )hm_cen
cen_offset	directionz_coordimdatasetZkitticheckpointslogs)'argparseArgumentParseradd_argumentintstrfloatedictvars
parse_argstorchdeviceZno_cudar   device_countngpus_per_node
pin_memory
input_sizehm_sizeZ
down_ratiomax_objectsimagenet_pretrained	head_convnum_classesZnum_center_offsetZnum_zZnum_dimZnum_directionheadsZnum_input_featuresospathjoinroot_dirdataset_dirsaved_fncheckpoints_dirlogs_dirisdirmakedirs)parserconfigs rL   J/home/opencvuniv/work/pranav/ADAS_2_LIDAR/SFA3D/sfa/config/train_config.pyparse_train_configs   s    










rN   )__doc__r@   r+   r4   Zeasydictr   r1   rN   rL   rL   rL   rM   <module>   s
   
