severstal-steel-defect-detection icon indicating copy to clipboard operation
severstal-steel-defect-detection copied to clipboard

unexpected keyword argument

Open Overcautious opened this issue 3 years ago • 3 comments

Hello, when I run "sever train -c experiments/unet-b5.yml", there is an error: TypeError: init() got an unexpected keyword argument 'dropout' TypeError: init() got an unexpected keyword argument 'weight_std' Then I delete keywords and it is able to run successfully, Why does this happen, have you deleted some modules ?

Overcautious avatar Apr 23 '21 13:04 Overcautious

hello Overcautious, how to run successfully? I'm try delete dropout and weight_std, but this new error. 4112 - Runner - INFO - Using random seed: 447676 4112 - Runner - DEBUG - Building model architecture Traceback (most recent call last): File "C:\Users\HPDQ\anaconda3\envs\server\Scripts\sever-script.py", line 33, in sys.exit(load_entry_point('sever', 'console_scripts', 'sever')()) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1137, in call return self.main(*args, **kwargs) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1062, in main rv = self.invoke(ctx) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 763, in invoke return _callback(*args, **kwargs) File "c:\users\hpdq\severstal-steel-defect-detection\sever\cli.py", line 37, in train Runner(config).train(resume) File "c:\users\hpdq\severstal-steel-defect-detection\sever\main.py", line 37, in train model = get_instance(module_arch, 'arch', config) File "c:\users\hpdq\severstal-steel-defect-detection\sever\main.py", line 21, in get_instance return getattr(module, config[name]['type'])(*args, **config[name]['args']) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\fpn\model.py", line 65, in init weights=encoder_weights, File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders_init.py", line 64, in get_encoder encoder.set_in_channels(in_channels, pretrained=weights is not None) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders_base.py", line 29, in set_in_channels utils.patch_first_conv(model=self, new_in_channels=in_channels, pretrained=pretrained) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders_utils.py", line 37, in patch_first_conv new_in_channels // module.groups, TypeError: unsupported operand type(s) for //: 'str' and 'int'

quangletrong1998 avatar Sep 24 '21 13:09 quangletrong1998

hello Overcautious, how to run successfully? I'm try delete dropout and weight_std, but this new error. 4112 - Runner - INFO - Using random seed: 447676 4112 - Runner - DEBUG - Building model architecture Traceback (most recent call last): File "C:\Users\HPDQ\anaconda3\envs\server\Scripts\sever-script.py", line 33, in sys.exit(load_entry_point('sever', 'console_scripts', 'sever')()) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1137, in call return self.main(*args, **kwargs) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1062, in main rv = self.invoke(ctx) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\click\core.py", line 763, in invoke return callback(*args, **kwargs) File "c:\users\hpdq\severstal-steel-defect-detection\sever\cli.py", line 37, in train Runner(config).train(resume) File "c:\users\hpdq\severstal-steel-defect-detection\sever\main.py", line 37, in train model = get_instance(module_arch, 'arch', config) File "c:\users\hpdq\severstal-steel-defect-detection\sever\main.py", line 21, in get_instance return getattr(module, config[name]['type'])(*args, **config[name]['args']) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\fpn\model.py", line 65, in init weights=encoder_weights, File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders__init.py", line 64, in get_encoder encoder.set_in_channels(in_channels, pretrained=weights is not None) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders_base.py", line 29, in set_in_channels utils.patch_first_conv(model=self, new_in_channels=in_channels, pretrained=pretrained) File "C:\Users\HPDQ\anaconda3\envs\server\lib\site-packages\segmentation_models_pytorch\encoders_utils.py", line 37, in patch_first_conv new_in_channels // module.groups, TypeError: unsupported operand type(s) for //: 'str' and 'int'

You should modify the configuration file, I have modify the file of "experiments/unet-b5.yml", them it run successfully

Overcautious avatar Sep 24 '21 13:09 Overcautious

yes, i was trying: sever train -c experiments/unet-b5.yml

arch: type: Unet args: activation: null classes: 4 encoder_name: efficientnet-b5 encoder_weights: imagenet in_channels: r

and then on the terminal should previous error. I think the config = unet-b5, because i can not find config.yml. If there is something wrong, please guide me !!!

quangletrong1998 avatar Sep 24 '21 14:09 quangletrong1998