Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prolific Dreamer "AttributeError: 'NoneType' object has no attribute 'replace'" error in Google Colab #200

Open
evanmrose opened this issue Jul 1, 2023 · 3 comments

Comments

@evanmrose
Copy link

Running the following training steps in the Google Colab example:

!python launch.py --config configs/prolificdreamer.yaml --train --gpu 0 system.prompt_processor.prompt="$prompt"
!python launch.py --config configs/prolificdreamer-geometry.yaml --train --gpu 0 system.prompt_processor.prompt="$prompt" system.geometry_convert_from=$save_dir/../ckpts/last.ckpt
!python launch.py --config configs/prolificdreamer-texture.yaml --train --gpu 0 system.prompt_processor.prompt="$prompt" system.geometry_convert_from=$save_dir/../ckpts/last.ckpt

Yields this error:

AssertionError
2023-07-01 13:37:23.524754: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
/usr/local/lib/python3.10/dist-packages/controlnet_aux/mediapipe_face/mediapipe_face_common.py:7: UserWarning: The module 'mediapipe' is not installed. The package will have limited functionality. Please install it using the command: pip install 'mediapipe'
  warnings.warn(
╭───────────────────── Traceback (most recent call last) ──────────────────────╮
│ /usr/local/lib/python3.10/dist-packages/omegaconf/base.py:764 in             │
│ resolve_parse_tree                                                           │
│                                                                              │
│   761 │   │   │   memo=memo,                                                 │
│   762 │   │   )                                                              │
│   763 │   │   try:                                                           │
│ ❱ 764 │   │   │   return visitor.visit(parse_tree)                           │
│   765 │   │   except InterpolationResolutionError:                           │
│   766 │   │   │   raise                                                      │
│   767 │   │   except Exception as exc:                                       │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py:34 in visit      │
│                                                                              │
│    31                                                                        │
│    32 class ParseTreeVisitor(object):                                        │
│    33 │   def visit(self, tree):                                             │
│ ❱  34 │   │   return tree.accept(self)                                       │
│    35 │                                                                      │
│    36 │   def visitChildren(self, node):                                     │
│    37 │   │   result = self.defaultResult()                                  │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGramm │
│ arParser.py:206 in accept                                                    │
│                                                                              │
│    203 │   │                                                                 │
│    204 │   │   def accept(self, visitor:ParseTreeVisitor):                   │
│    205 │   │   │   if hasattr( visitor, "visitConfigValue" ):                │
│ ❱  206 │   │   │   │   return visitor.visitConfigValue(self)                 │
│    207 │   │   │   else:                                                     │
│    208 │   │   │   │   return visitor.visitChildren(self)                    │
│    209                                                                       │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py:101 in  │
│ visitConfigValue                                                             │
│                                                                              │
│    98 │   def visitConfigValue(self, ctx: OmegaConfGrammarParser.ConfigValue │
│    99 │   │   # text EOF                                                     │
│   100 │   │   assert ctx.getChildCount() == 2                                │
│ ❱ 101 │   │   return self.visit(ctx.getChild(0))                             │
│   102 │                                                                      │
│   103 │   def visitDictKey(self, ctx: OmegaConfGrammarParser.DictKeyContext) │
│   104 │   │   return self._createPrimitive(ctx)                              │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py:34 in visit      │
│                                                                              │
│    31                                                                        │
│    32 class ParseTreeVisitor(object):                                        │
│    33 │   def visit(self, tree):                                             │
│ ❱  34 │   │   return tree.accept(self)                                       │
│    35 │                                                                      │
│    36 │   def visitChildren(self, node):                                     │
│    37 │   │   result = self.defaultResult()                                  │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGramm │
│ arParser.py:342 in accept                                                    │
│                                                                              │
│    339 │   │                                                                 │
│    340 │   │   def accept(self, visitor:ParseTreeVisitor):                   │
│    341 │   │   │   if hasattr( visitor, "visitText" ):                       │
│ ❱  342 │   │   │   │   return visitor.visitText(self)                        │
│    343 │   │   │   else:                                                     │
│    344 │   │   │   │   return visitor.visitChildren(self)                    │
│    345                                                                       │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py:298 in  │
│ visitText                                                                    │
│                                                                              │
│   295 │   │   if ctx.getChildCount() == 1:                                   │
│   296 │   │   │   c = ctx.getChild(0)                                        │
│   297 │   │   │   if isinstance(c, OmegaConfGrammarParser.InterpolationConte │
│ ❱ 298 │   │   │   │   return self.visitInterpolation(c)                      │
│   299 │   │                                                                  │
│   300 │   │   # Otherwise, concatenate string representations together.      │
│   301 │   │   return self._unescape(list(ctx.getChildren()))                 │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py:125 in  │
│ visitInterpolation                                                           │
│                                                                              │
│   122 │   │   self, ctx: OmegaConfGrammarParser.InterpolationContext         │
│   123 │   ) -> Any:                                                          │
│   124 │   │   assert ctx.getChildCount() == 1  # interpolationNode | interpo │
│ ❱ 125 │   │   return self.visit(ctx.getChild(0))                             │
│   126 │                                                                      │
│   127 │   def visitInterpolationNode(                                        │
│   128 │   │   self, ctx: OmegaConfGrammarParser.InterpolationNodeContext     │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/antlr4/tree/Tree.py:34 in visit      │
│                                                                              │
│    31                                                                        │
│    32 class ParseTreeVisitor(object):                                        │
│    33 │   def visit(self, tree):                                             │
│ ❱  34 │   │   return tree.accept(self)                                       │
│    35 │                                                                      │
│    36 │   def visitChildren(self, node):                                     │
│    37 │   │   result = self.defaultResult()                                  │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar/gen/OmegaConfGramm │
│ arParser.py:1041 in accept                                                   │
│                                                                              │
│   1038 │   │                                                                 │
│   1039 │   │   def accept(self, visitor:ParseTreeVisitor):                   │
│   1040 │   │   │   if hasattr( visitor, "visitInterpolationResolver" ):      │
│ ❱ 1041 │   │   │   │   return visitor.visitInterpolationResolver(self)       │
│   1042 │   │   │   else:                                                     │
│   1043 │   │   │   │   return visitor.visitChildren(self)                    │
│   1044                                                                       │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/grammar_visitor.py:179 in  │
│ visitInterpolationResolver                                                   │
│                                                                              │
│   176 │   │   │   │   args.append(val)                                       │
│   177 │   │   │   │   args_str.append(txt)                                   │
│   178 │   │                                                                  │
│ ❱ 179 │   │   return self.resolver_interpolation_callback(                   │
│   180 │   │   │   name=resolver_name,                                        │
│   181 │   │   │   args=tuple(args),                                          │
│   182 │   │   │   args_str=tuple(args_str),                                  │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/base.py:750 in             │
│ resolver_interpolation_callback                                              │
│                                                                              │
│   747 │   │   def resolver_interpolation_callback(                           │
│   748 │   │   │   name: str, args: Tuple[Any, ...], args_str: Tuple[str, ... │
│   749 │   │   ) -> Any:                                                      │
│ ❱ 750 │   │   │   return self._evaluate_custom_resolver(                     │
│   751 │   │   │   │   key=key,                                               │
│   752 │   │   │   │   node=node,                                             │
│   753 │   │   │   │   inter_type=name,                                       │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/base.py:694 in             │
│ _evaluate_custom_resolver                                                    │
│                                                                              │
│   691 │   │   resolver = OmegaConf._get_resolver(inter_type)                 │
│   692 │   │   if resolver is not None:                                       │
│   693 │   │   │   root_node = self._get_root()                               │
│ ❱ 694 │   │   │   return resolver(                                           │
│   695 │   │   │   │   root_node,                                             │
│   696 │   │   │   │   self,                                                  │
│   697 │   │   │   │   node,                                                  │
│                                                                              │
│ /usr/local/lib/python3.10/dist-packages/omegaconf/omegaconf.py:445 in        │
│ resolver_wrapper                                                             │
│                                                                              │
│    442 │   │   │   if pass_root:                                             │
│    443 │   │   │   │   kwargs["_root_"] = config                             │
│    444 │   │   │                                                             │
│ ❱  445 │   │   │   ret = resolver(*args, **kwargs)                           │
│    446 │   │   │                                                             │
│    447 │   │   │   if use_cache:                                             │
│    448 │   │   │   │   cache[args_str] = ret                                 │
│                                                                              │
│ /content/threestudio/threestudio/utils/config.py:20 in <lambda>              │
│                                                                              │
│    17 OmegaConf.register_new_resolver("div", lambda a, b: a / b)             │
│    18 OmegaConf.register_new_resolver("idiv", lambda a, b: a // b)           │
│    19 OmegaConf.register_new_resolver("basename", lambda p: os.path.basename │
│ ❱  20 OmegaConf.register_new_resolver("rmspace", lambda s, sub: s.replace("  │
│    21 OmegaConf.register_new_resolver("tuple2", lambda s: [float(s), float(s │
│    22 OmegaConf.register_new_resolver("gt0", lambda s: s > 0)                │
│    23 OmegaConf.register_new_resolver("not", lambda s: not s)                │
╰──────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'NoneType' object has no attribute 'replace'

@bennyguo
Copy link
Collaborator

bennyguo commented Jul 3, 2023

Could you try to replace $prompt with a specific string and see if it works?

@evanmrose
Copy link
Author

evanmrose commented Jul 3, 2023

The $prompt is set as "a photorealistic grand piano" in the previous block.

@bennyguo
Copy link
Collaborator

bennyguo commented Jul 4, 2023

It seems that the prompt is not correctly set. Could you try running with system.prompt_processor.prompt="a photorealistic grand piano"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants