DeforumStableDiffusionLocal icon indicating copy to clipboard operation
DeforumStableDiffusionLocal copied to clipboard

free variable 'device' referenced before assignment in enclosing scope

Open ramsesisaid opened this issue 2 years ago • 4 comments

Hello sorry to bother you with this. I can make it run on my PC

(ldm) C:\aivids\DeforumStableDiffusionLocal-main>python run.py --enable_animation_mode --settings "./examples/runSettings_Animation.txt" Local Path Variables:

models_path: ./models output_path: ./output Using config: ./stable-diffusion/configs/stable-diffusion/v1-inference.yaml Please download model checkpoint and place in ./models\sd-v1-4.ckpt Saving animation frames to ./output\2022-09\Example_DGSpitzer Traceback (most recent call last): File "run.py", line 1312, in main() File "run.py", line 1250, in main render_animation(args, anim_args) File "run.py", line 953, in render_animation depth_model = DepthModel(device) NameError: free variable 'device' referenced before assignment in enclosing scope <===== THIS

The same is happening in collab

NameError Traceback (most recent call last) in 480 # dispatch to appropriate renderer 481 if anim_args.animation_mode == '2D' or anim_args.animation_mode == '3D': --> 482 render_animation(args, anim_args) 483 elif anim_args.animation_mode == 'Video Input': 484 render_input_video(args, anim_args)

in render_animation(args, anim_args) 185 predict_depths = (anim_args.animation_mode == '3D' and anim_args.use_depth_warping) or anim_args.save_depth_maps 186 if predict_depths: --> 187 depth_model = DepthModel(device) 188 depth_model.load_midas(models_path) 189 if anim_args.midas_weight < 1.0:

NameError: name 'device' is not defined <=====THIS

ramsesisaid avatar Sep 21 '22 14:09 ramsesisaid

Please download model checkpoint and place in ./models\sd-v1-4.ckpt <------ Looks like you need the sd-v1-4.ckpt

sqletor420 avatar Sep 22 '22 02:09 sqletor420

Hello sorry to bother you with this. I can make it run on my PC

(ldm) C:\aivids\DeforumStableDiffusionLocal-main>python run.py --enable_animation_mode --settings "./examples/runSettings_Animation.txt" Local Path Variables:

models_path: ./models output_path: ./output Using config: ./stable-diffusion/configs/stable-diffusion/v1-inference.yaml Please download model checkpoint and place in ./models\sd-v1-4.ckpt Saving animation frames to ./output\2022-09\Example_DGSpitzer Traceback (most recent call last): File "run.py", line 1312, in main() File "run.py", line 1250, in main render_animation(args, anim_args) File "run.py", line 953, in render_animation depth_model = DepthModel(device) NameError: free variable 'device' referenced before assignment in enclosing scope <===== THIS

The same is happening in collab

NameError Traceback (most recent call last) in 480 # dispatch to appropriate renderer 481 if anim_args.animation_mode == '2D' or anim_args.animation_mode == '3D': --> 482 render_animation(args, anim_args) 483 elif anim_args.animation_mode == 'Video Input': 484 render_input_video(args, anim_args)

in render_animation(args, anim_args) 185 predict_depths = (anim_args.animation_mode == '3D' and anim_args.use_depth_warping) or anim_args.save_depth_maps 186 if predict_depths: --> 187 depth_model = DepthModel(device) 188 depth_model.load_midas(models_path) 189 if anim_args.midas_weight < 1.0:

NameError: name 'device' is not defined <=====THIS

Do you know from helpers import DepthModel come from where? thanks

Trway avatar Sep 22 '22 04:09 Trway

Please download model checkpoint and place in ./models\sd-v1-4.ckpt <------ Looks like you need the sd-v1-4.ckpt

I already have it there. in colab

image

ramsesisaid avatar Sep 22 '22 12:09 ramsesisaid

I'm having the same issue, have you found a resolve?

afrofail avatar Oct 13 '22 10:10 afrofail