Comments (1)
#18 is related. I also had the same error. Adding global seed_worker
to Diffusion.sample_sequence
in diffusion.py fails to resolve issue:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\shaw\Anaconda3\lib\multiprocessing\spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "C:\Users\shaw\Anaconda3\lib\multiprocessing\spawn.py", line 126, in _main
self = reduction.pickle.load(from_parent)
AttributeError: Can't get attribute 'seed_worker' on <module 'runners.diffusion' from 'C:\\Users\\shaw\\Documents\\Year 2\\Diffusion Models\\ddrm\\runners\\diffusion.py'>
The reason (in my case) is that when running on Windows the multiprocessing
module uses spawn
and so one must (according to docs):
Wrap most of you main script’s code within if name == 'main': block, to make sure it doesn’t run again (most likely generating error) when each worker process is launched. You can place your dataset and DataLoader instance creation logic here, as it doesn’t need to be re-executed in workers.
Make sure that any custom collate_fn, worker_init_fn or dataset code is declared as top level definitions, outside of the main check. This ensures that they are available in worker processes. (this is needed since functions are pickled as references only, not bytecode.)
It is difficult to implement this advice since the seed_worker
function needs access to the input args
coming from the config file.
Simplest "solution" was to just set the worker_init_fn
argument to None
as below (within Diffusion.sample_sequence
):
val_loader = data.DataLoader(
test_dataset,
batch_size=config.sampling.batch_size,
shuffle=True,
num_workers=config.data.num_workers,
worker_init_fn=None,
generator=g,
)
from ddrm.
Related Issues (20)
- Generating Samples from Noise
- demos for Colorization
- re-training diffusion model HOT 1
- about train
- about exp folder HOT 1
- RuntimeError: CUDA error: out of memory HOT 1
- How to reproduce the inpainting experiments?
- About the theoretical derivation~
- Attribute Error: Can't pickle local object
- RuntimeError: PytorchStreamReader failed reading zip archive: failed finding central directory
- Derviation of the equation 17 in supplemental document HOT 1
- Restoration for real-world images
- [Question] Is there an easy way to test an arbitrary single image?
- [Arbitrary image size support]?
- Access Denied on CELEBA_HQ checkpoint HOT 1
- How to use my own dataset?
- Doesn't seem to generalize well HOT 5
- Error when using image_256_cc.yml HOT 1
- Error when using image_512_cc.yml HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ddrm.