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

RuntimeError: Method 'forward' is not defined #91

Open
griffinhcollins opened this issue May 13, 2021 · 1 comment
Open

RuntimeError: Method 'forward' is not defined #91

griffinhcollins opened this issue May 13, 2021 · 1 comment

Comments

@griffinhcollins
Copy link

Hi, I've just started with big_sleep but just trying to run the demo code:

from big_sleep import Imagine

dream = Imagine(
text = "fire in the sky",
lr = 5e-2,
save_every = 25,
save_progress = True
)

dream()

I keep getting the error "method forward is not defined"

I looked it up and found this thread but it seemed the solution was to update to 0.7.1, and I'm using 0.8.5, any ideas? Thanks!

@griffinhcollins
Copy link
Author

Here's the stacktrace:
Traceback (most recent call last):
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\griff.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy_main
.py", line 45, in
cli.main()
File "c:\Users\griff.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 444, in main
run()
File "c:\Users\griff.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 285, in run_file
runpy.run_path(target_as_str, run_name=compat.force_str("main"))
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 265, in run_path
return _run_module_code(code, init_globals, run_name,
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 97, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "c:\Users\griff\Documents\Various Crap\Big Sleep\big sleep.py", line 1, in
from big_sleep import Imagine
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\big_sleep_init
.py", line 1, in
from big_sleep.big_sleep import BigSleep, Imagine
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\big_sleep\big_sleep.py", line 83, in
perceptor, preprocess = load()
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\big_sleep\clip.py", line 192, in load
model.apply(patch_device)
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 473, in apply
module.apply(fn)
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 473, in apply
module.apply(fn)
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 473, in apply
module.apply(fn)
[Previous line repeated 3 more times]
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\nn\modules\module.py", line 474, in apply
fn(self)
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\big_sleep\clip.py", line 183, in patch_device
graphs = [module.graph] if hasattr(module, "graph") else []
File "C:\Users\griff\AppData\Local\Programs\Python\Python38\lib\site-packages\torch\jit_script.py", line 449, in graph
return self._c._get_method("forward").graph
RuntimeError: Method 'forward' is not defined.

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

1 participant