Closed franferraz98 closed 2 years ago
Hey,
I can't say what exactly the error is by looking at your code, but what you do is highly dangerous and might lead to bugs.
BlenderProc is designed to be rerun multiple times to create a dataset, do not I repeat do not run it once to create all images.
So every loop of yours should be done in a separate BlenderProc run, this might make it a tiny bit slower (1-3%) depending on your object size, but avoids blender pitfalls like you experience currently. Blender is just not designed to render hundreds of images with ever changing scenes, that's why we recommend to rerun BlenderProc several times avoiding messing up the internal state machine blender is.
Best, Max
Hi!
Thanks for the quick response. So if I got you right, I should basically make an external (bash) script that invokes blenderproc run main.py
serveral times instead of looping inside the main function?
In that case I'd be loading the whole scene each time I need to render an image. Isn't that super inefficient?
Thanks in any case, I'll try it later!
Hey,
Thanks for the quick response. So if I got you right, I should basically make an external (bash) script that invokes blenderproc run main.py serveral times instead of looping inside the main function?
Exactly, you can also use python for that ;) subprocess.run()
In that case I'd be loading the whole scene each time I need to render an image. Isn't that super inefficient?
I wouldn't do it for every frame, but the idea is that you load a scene render let's say 5-10 images in this one fixed scene. Restart BlenderProc and render another 5-10 frames and so on.
Best, Max
Okay, I'll try it.
Okay, it works. Thanks for your help, I'll close the issue now.
Still, I'm a bit confused about this. What could possibly change between generating 10 images or 50? Is this a Blender issue?
Hey @franferraz98,
good to know that it works now! We are also a bit confused why 50 iterations does not work. The only limitation should be the available resources (memory, disk space...).
Could you transform your code into a minimal example, which still produces the error? It would be a great help for us to be able to reproduce the behavior.
Sure, I'll do it when I get a bit of spare time. Today I'm a bit busy but I think I can have it in 2-3 days.
@franferraz98 thanks, did you already find some time to look into it?
No sorry, I've been dealing with some other projects and haven't been able to tackle this. I think that next week I will find some time, I'll keep you updated.
Describe the bug I've set up a script that generates images on a loop. It loads some objects from .blend files, modifies them and renders one single image each time. Without any error logs or messages, the execution stops each 42 iterations. Nothing works wrong apparently, but if I try to set a number of iterations bigger than 42, it stops early.
General Information
Which BlenderProc version are you using? 2.2.0
On which operating system are you? Ubuntu 20.04
Have you checked the issue tracker to see if a similar issue has been opened? Yes, didn't find any.
Have you changed BlenderProc in any way besides the config file? If yes, are you sure that this change does not affect the problem you are having? No, I haven't changed it.
To Reproduce Steps to reproduce the behavior:
blenderproc run main.py
It will most probably not be useful as I'm using some libraries, but:
Expected behavior The generation of 200 images, as stated in my config file.
Screenshots These are the last lines printed while executing.
Additional context None