haofanwang / ControlNet-for-Diffusers

Transfer the ControlNet with any basemodel in diffusers🔥
MIT License
813 stars 48 forks source link

Can't load state_dict of control model in Google Colab #3

Closed ducpham01 closed 1 year ago

ducpham01 commented 1 year ago

Hi! As I follow your Colab notebook. There seems to have an error while loading control model for conversion in tool_transfer_control.py. Detailed log here:

/content/ControlNet
2023-02-23 03:43:39.735813: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2023-02-23 03:43:45.107427: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer.so.7'; dlerror: libnvinfer.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
2023-02-23 03:43:45.108480: W tensorflow/compiler/xla/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libnvinfer_plugin.so.7'; dlerror: libnvinfer_plugin.so.7: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
2023-02-23 03:43:45.108525: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Cannot dlopen some TensorRT libraries. If you would like to use Nvidia GPU with TensorRT, please make sure the missing libraries mentioned above are installed properly.
logging improved.
Loaded state_dict from [./models/v1-5-pruned.ckpt]
^C

It automatically terminated the command while loading load_state_dict(path_sd15_with_control). Do you have the same problem while running in Colab?

haofanwang commented 1 year ago

If you are on Colab free plan with only 12GB memory, it will lead to OOM. Try to run the scripts on your local machine with larger RAM. Anyway, thanks for pointing out, I will update this info to README.md.

@ducpham01

ducpham01 commented 1 year ago

Oh, thank you for your clarification