lama icon indicating copy to clipboard operation
lama copied to clipboard

got error when I want to train with celeba dataset (AttributeError: 'NoneType' object has no attribute 'tb_lasti')

Open arad2022 opened this issue 2 years ago • 2 comments

Hi, I used this command after prepared dataset python bin/train.py -cn lama-fourier-celeba data.batch_size=10 but I got this below error. Why it's happen? How I can fix it? I'm using windows os. @windj007 ### Error: C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'hydra/overrides': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'trainer/any_gpu_large_ssim_ddp_final_celeba': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'evaluator/default_inpainted': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'visualizer/directory': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'optimizers/default_optimizers': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'discriminator/pix2pixhd_nlayer': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'generator/ffc_resnet_075': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'data/abl-04-256-mh-dist-celeba': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\default_element.py:127: UserWarning: In 'location/docker': Usage of deprecated keyword in package header '# @package group'. See https://hydra.cc/docs/next/upgrades/1.0_to_1.1/changes_to_package_header for more information See {url} for more information""" C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\resolvers_init_.py:13: UserWarning: The env resolver is deprecated, see https://github.com/omry/omegaconf/issues/573 "The env resolver is deprecated, see https://github.com/omry/omegaconf/issues/573" Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra_internal\utils.py", line 211, in run_and_report return func() File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra_internal\utils.py", line 371, in overrides=args.overrides, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra_internal\hydra.py", line 105, in run configure_logging=with_log_configuration, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\core\utils.py", line 122, in run_job working_dir = str(OmegaConf.select(config, job_dir_key)) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\omegaconf.py", line 691, in select format_and_raise(node=cfg, key=key, value=None, cause=e, msg=str(e)) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf_utils.py", line 821, in format_and_raise _raise(ex, cause) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf_utils.py", line 719, in _raise raise ex.with_traceback(sys.exc_info()[2]) # set end OC_CAUSE=1 for full backtrace File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\omegaconf.py", line 688, in select throw_on_missing=throw_on_missing, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf_impl.py", line 63, in select_value absolute_key=absolute_key, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf_impl.py", line 96, in select_node throw_on_resolution_failure=throw_on_resolution_failure, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 434, in _select_impl memo=memo, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 622, in _maybe_resolve_interpolation memo=memo if memo is not None else set(), File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 483, in _resolve_interpolation_from_parse_tree parse_tree=parse_tree, node=value, key=key, parent=parent, memo=memo File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 669, in resolve_parse_tree ).with_traceback(sys.exc_info()[2]) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 662, in resolve_parse_tree return visitor.visit(parse_tree) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\antlr4\tree\Tree.py", line 34, in visit return tree.accept(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar\gen\OmegaConfGrammarParser.py", line 205, in accept return visitor.visitConfigValue(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar_visitor.py", line 101, in visitConfigValue return self.visit(ctx.getChild(0)) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\antlr4\tree\Tree.py", line 34, in visit return tree.accept(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar\gen\OmegaConfGrammarParser.py", line 339, in accept return visitor.visitText(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar_visitor.py", line 301, in visitText return self._unescape(list(ctx.getChildren())) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar_visitor.py", line 389, in _unescape text = str(self.visitInterpolation(node)) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar_visitor.py", line 125, in visitInterpolation return self.visit(ctx.getChild(0)) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\antlr4\tree\Tree.py", line 34, in visit return tree.accept(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar\gen\OmegaConfGrammarParser.py", line 1030, in accept return visitor.visitInterpolationResolver(self) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\grammar_visitor.py", line 182, in visitInterpolationResolver args_str=tuple(args_str), File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 653, in resolver_interpolation_callback inter_args_str=args_str, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\base.py", line 596, in evaluate_custom_resolver inter_args_str, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\omegaconf.py", line 355, in resolver_wrapper val = cache[key] if key in cache else resolver(*args_unesc) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\omegaconf\resolvers_init.py", line 22, in env raise ValidationError(f"Environment variable '{key}' not found") omegaconf.errors.InterpolationResolutionError: ValidationError raised while resolving interpolation: Environment variable 'USER' not found full_key: hydra.run.dir object_type=dict

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "bin/train.py", line 72, in main() File "G:\codes\lama-main\saicinpainting\utils.py", line 163, in new_main main_func(*args, **kwargs) File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra\main.py", line 53, in decorated_main config_name=config_name, File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra_internal\utils.py", line 368, in _run_hydra lambda: hydra.run( File "C:\ProgramData\Anaconda3\envs\pytorch171\lib\site-packages\hydra_internal\utils.py", line 270, in run_and_report cur.tb_lasti = iter_tb.tb_lasti AttributeError: 'NoneType' object has no attribute 'tb_lasti'

arad2022 avatar May 03 '22 18:05 arad2022

Hi! Set USER environment variable to any value, see this issue. You're trying to train, so you might also need TORCH_HOME environment (this issue).

I do not have a Windows machine, so I cannot test the code under Windows. It might worth trying Windows Linux Subsystem - the easiest way to use Linux from a Windows machine - many open source machine learning tools work better under Linux.

windj007 avatar May 06 '22 10:05 windj007

I've tested the code on windows. It works perfectly.

FBehrad avatar Sep 03 '22 05:09 FBehrad

I've tested the code on windows. It works perfectly.

Hi,How do you solve this problem on Windows?

Be-a-Warior avatar Oct 20 '22 13:10 Be-a-Warior

I got a problom like this. Did you solve this problem? Training failed due to "'Box' object has no attribute 'visualizer'": Traceback (most recent call last): File "box\box.py", line 504, in box.box.Box.getitem KeyError: 'visualizer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "box\box.py", line 537, in box.box.Box.getattr File "box\box.py", line 525, in box.box.Box.getitem box.exceptions.BoxKeyError: "'visualizer'"

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "box\box.py", line 539, in box.box.Box.getattr AttributeError: 'Box' object has no attribute 'visualizer'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "D:\jsc\LAMA\lama-main\bin\train.py", line 44, in main config.visualizer.outdir = os.path.join(os.getcwd(), config.visualizer.outdir) File "box\box.py", line 553, in box.box.Box.getattr box.exceptions.BoxKeyError: "'Box' object has no attribute 'visualizer'"

overweighted avatar Jan 16 '23 10:01 overweighted