f2cfe65d09
>It shouldn’t matter, as the optimizer should hold the references to the parameter (even after moving them). However, the “safer” approach would be to move the model to the device first and create the optimizer afterwards. https://discuss.pytorch.org/t/should-i-create-optimizer-after-sending-the-model-to-gpu/133418/2 https://discuss.pytorch.org/t/effect-of-calling-model-cuda-after-constructing-an-optimizer/15165 At least in my experience with hivemind, if you initialize the optimizer and move the model afterwards, it will throw errors about finding some data in CPU and other on GPU. This shouldn't affect performance or anything I believe. |
||
---|---|---|
.. | ||
diffusers_trainer.py | ||
train.sh |