Yao-DD / S3N

86 stars 26 forks source link

some important params of Nest module "multi_smooth_loss" have been forgotten in use. #3

Open zlweiyang opened 4 years ago

zlweiyang commented 4 years ago

PYTHONWARNINGS='ignore' CUDA_VISIBLE_DEVICES=2,3 nest task run ./demo/cub_s3n.yml calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. train ./datasets/CUB_200_2011/images ./datasets/CUB_200_2011/train.txt test ./datasets/CUB_200_2011/images ./datasets/CUB_200_2011/test.txt Multiple Nest modules match the given regex have been found. The returned module is "nest_pytorch.network_trainer", but you can adjust regex to specify others: [0] nest_pytorch.network_trainer (data_loaders:Tuple[List[Tuple[str, torch.utils.data.dataloader.DataLoader]], List[Tuple[str, torch.utils.data.dataloader.DataLoader]]], model:torch.nn.modules.module.Module, criterion:Callable[[torch.Tensor, torch.Tensor], torch.Tensor], optimizer:Callable[[Iterable], torch.optim.optimizer.Optimizer], parameter:Union[Callable, NoneType]=None, meters:Union[Dict[str, Callable[[nest.modules.Context], Any]], NoneType]=None, hooks:Union[Dict[str, List[Callable[[nest.modules.Context], NoneType]]], NoneType]=None, max_epoch:int=200, test_interval:int=1, resume:Union[str, NoneType]=None, log_path:Union[str, NoneType]=None, device:str='cuda', use_data_parallel:bool=True, use_cudnn_benchmark:bool=True, random_seed:int=999) -> nest.modules.Context [1] s3n.network_trainer (data_loaders:Tuple[List[Tuple[str, torch.utils.data.dataloader.DataLoader]], List[Tuple[str, torch.utils.data.dataloader.DataLoader]]], model:torch.nn.modules.module.Module, criterion:object, optimizer:Callable[[Iterable], torch.optim.optimizer.Optimizer], parameter:Union[Callable, NoneType]=None, meters:Union[Dict[str, Callable[[nest.modules.Context], Any]], NoneType]=None, hooks:Union[Dict[str, List[Callable[[nest.modules.Context], NoneType]]], NoneType]=None, max_epoch:int=200, test_interval:int=1, resume:Union[str, NoneType]=None, log_path:Union[str, NoneType]=None, device:str='cuda', use_data_parallel:bool=True, use_cudnn_benchmark:bool=True, random_seed:int=999) -> nest.modules.Context Exception occurred during resolving: Type: TypeError Message: The param "criterion" of Nest module "network_trainer" should be type of "Callable[[torch.Tensor, torch.Tensor], torch.Tensor]". Got multi_smooth_loss( input:Tuple, target:torch.Tensor, [✓] smooth_ratio:float=0.9, loss_weight:Union[NoneType, Dict]=None, weight:Union[NoneType, torch.Tensor]=None, size_average:bool=True, ignore_index:int=-100, reduce:bool=True) -> torch.Tensor Please check if some important params of Nest module "multi_smooth_loss" have been forgotten in use.

Yao-DD commented 4 years ago

You can comment out lines 114-122 in 'Nest/src/nest/modules.py' and reinstall Nest.

zlweiyang commented 4 years ago

thanks ! that works.But I want to know the meanings of test_branch1_top1,test_branch2_top1,test_branch3_top1,test_branch4_top1

Yao-DD commented 4 years ago

Test_branch1_top1,test_branch2_top1,test_branch3_top1,test_branch4_top1 match the top-1 accuracies of aggragation of all features, the origin image branch, the discriminative branch and the complementary branch.