Closed mobassir94 closed 10 months ago
downgrading tensorflow to 2.11.1 solved the issue in my case.
pip install tensorflow==2.11.1
and now facing new issue @wl-zhao
(diffusionswap) syedmobassir.hossain@hw004:~/DiffSwap/stable-diffusion-main/DiffSwap$ python pipeline.py -h
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 3.28it/s]
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 2.03it/s]
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 9.60it/s]
type source img_count 1
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 4.49it/s]
type target img_count 1
Recreating aligned images...
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 6.76it/s]
type source finished, processed 1 images
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 6.38it/s]
type target finished, processed 1 images
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 62.94it/s]
type source img_count 1
image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 56.84it/s]
type target img_count 1
running face detection
2023-10-22 17:46:52.105396: 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-10-22 17:46:52.974337: 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/cuda/lib64:
2023-10-22 17:46:52.974445: 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/cuda/lib64:
2023-10-22 17:46:52.974457: 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.
2023-10-22 17:46:54.179610: 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-10-22 17:46:54.803006: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1613] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 45381 MB memory: -> device: 0, name: NVIDIA RTX A6000, pci bus id: 0000:01:00.0, compute capability: 8.6
0%| | 0/1 [00:00<?, ?it/s]2023-10-22 17:46:57.409746: I tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:428] Loaded cuDNN version 8401
1/1 [==============================] - 3s 3s/step
1/1 [==============================] - 0s 123ms/step
1/1 [==============================] - 0s 48ms/step
1/1 [==============================] - 0s 47ms/step
1/1 [==============================] - 0s 46ms/step
1/1 [==============================] - 0s 47ms/step
1/1 [==============================] - 0s 46ms/step
1/1 [==============================] - 0s 45ms/step
2023-10-22 17:47:00.140135: I tensorflow/compiler/xla/stream_executor/cuda/cuda_blas.cc:630] TensorFloat-32 will be used for the matrix multiplication. This will only be logged once.
2/2 [==============================] - 0s 18ms/step
1/1 [==============================] - 0s 159ms/step
100%|█████████████████████████████████████████████| 1/1 [00:04<00:00, 4.49s/it]
1/1 [==============================] - 0s 23ms/step | 0/1 [00:00<?, ?it/s]
1/1 [==============================] - 0s 23ms/step
1/1 [==============================] - 0s 22ms/step
1/1 [==============================] - 0s 22ms/step
1/1 [==============================] - 0s 22ms/step
1/1 [==============================] - 0s 24ms/step
1/1 [==============================] - 0s 21ms/step
1/1 [==============================] - 0s 22ms/step
1/1 [==============================] - 0s 39ms/step
1/1 [==============================] - 0s 28ms/step
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 1.52it/s]
gpu 0 process 1 images
running mtcnn
source 0.png
target 0.png
obtain the parameters of affine transformation
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 50.80it/s]
type: source, cnt: 1
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 33.20it/s]
type: target, cnt: 1
len(self.src_list): 1
start batch
100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 6.05it/s]
shuf: write error: Broken pipe
shuf: write error
/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/torch/distributed/launch.py:178: FutureWarning: The module torch.distributed.launch is deprecated
and will be removed in future. Use torchrun.
Note that --use_env is set by default in torchrun.
If your script expects --local_rank
argument to be set, please
change it to read from os.environ['LOCAL_RANK']
instead. See
https://pytorch.org/docs/stable/distributed.html#launch-utility for
further instructions
Failures:
silly me,didn't read the error message carefully,, init.py files were missing
i have followed installation instruction exactly like you mentioned in your readme,didn't notice any error during installation but when i try to predict using
python pipeline.py
i face the error below(diffusionswap) syedmobassir.hossain@hw004:~/DiffSwap/stable-diffusion-main/DiffSwap$ python pipeline.py 100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 3.42it/s] 100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 2.11it/s] image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 7.82it/s] type source img_count 1 image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 4.63it/s] type target img_count 1 Recreating aligned images... image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 6.84it/s] type source finished, processed 1 images image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 6.49it/s] type target finished, processed 1 images image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 74.05it/s] type source img_count 1 image: 100%|██████████████████████████████████████| 1/1 [00:00<00:00, 75.96it/s] type target img_count 1 running face detection 2023-10-19 18:58:38.661257: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations. To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags. 2023-10-19 18:58:41.360583: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1639] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 45525 MB memory: -> device: 0, name: NVIDIA RTX A6000, pci bus id: 0000:01:00.0, compute capability: 8.6 0%| | 0/1 [00:00<?, ?it/s]2023-10-19 18:58:43.342977: E tensorflow/compiler/xla/stream_executor/cuda/cuda_dnn.cc:425] Loaded runtime CuDNN library: 8.4.1 but source was compiled with: 8.6.0. CuDNN library needs to have matching major version and equal or higher minor version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration. 2023-10-19 18:58:43.344027: W tensorflow/core/framework/op_kernel.cc:1828] OP_REQUIRES failed at conv_ops_impl.h:770 : UNIMPLEMENTED: DNN library is not found. 0%| | 0/1 [00:01<?, ?it/s] Traceback (most recent call last): File "data_preprocessing/detection/detcect_faces_portrait.py", line 28, in
result = detector.detect_faces(image)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/mtcnn/mtcnn.py", line 300, in detect_faces
result = stage(img, result[0], result[1])
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/mtcnn/mtcnn.py", line 342, in __stage1
out = self._pnet.predict(img_y)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/tensorflow/python/eager/execute.py", line 53, in quick_execute
tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.UnimplementedError: Graph execution error:
Detected at node 'model/conv2d/Conv2D' defined at (most recent call last): File "data_preprocessing/detection/detcect_faces_portrait.py", line 28, in
result = detector.detect_faces(image)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/mtcnn/mtcnn.py", line 300, in detect_faces
result = stage(img, result[0], result[1])
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/mtcnn/mtcnn.py", line 342, in stage1
out = self._pnet.predict(img_y)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 65, in error_handler
return fn(*args, kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 2554, in predict
tmp_batch_outputs = self.predict_function(iterator)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 2341, in predict_function
return step_function(self, iterator)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 2327, in step_function
outputs = model.distribute_strategy.run(run_step, args=(data,))
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 2315, in run_step
outputs = model.predict_step(data)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 2283, in predict_step
return self(x, training=False)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 65, in error_handler
return fn(*args, *kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/training.py", line 569, in call
return super().call(args, kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 65, in error_handler
return fn(*args, **kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/base_layer.py", line 1150, in call
outputs = call_fn(inputs, *args, kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 96, in error_handler
return fn(*args, *kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/functional.py", line 512, in call
return self._run_internal_graph(inputs, training=training, mask=mask)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/functional.py", line 669, in _run_internal_graph
outputs = node.layer(args, kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 65, in error_handler
return fn(*args, **kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/engine/base_layer.py", line 1150, in call
outputs = call_fn(inputs, *args, *kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/utils/traceback_utils.py", line 96, in error_handler
return fn(args, **kwargs)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/layers/convolutional/base_conv.py", line 290, in call
outputs = self.convolution_op(inputs, self.kernel)
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/site-packages/keras/src/layers/convolutional/base_conv.py", line 262, in convolution_op
return tf.nn.convolution(
Node: 'model/conv2d/Conv2D'
DNN library is not found.
[[{{node model/conv2d/Conv2D}}]] [Op:__inference_predict_function_917]
running mtcnn
Traceback (most recent call last):
File "data_preprocessing/detection/merge_mtcnnportrait.py", line 10, in
tmp = json.load(open('data/portrait/mtcnn/mtcnn {}.json'.format(i), 'r'))
FileNotFoundError: [Errno 2] No such file or directory: 'data/portrait/mtcnn/mtcnn_0.json'
obtain the parameters of affine transformation
Traceback (most recent call last):
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/syedmobassir.hossain/anaconda3/envs/diffusionswap/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/syedmobassir.hossain/DiffSwap/stable-diffusion-main/DiffSwap/data_preprocessing/align/face_align_portrait.py", line 32, in
results_all = json.load(open('data/portrait/mtcnn/mtcnn_256.json'))
FileNotFoundError: [Errno 2] No such file or directory: 'data/portrait/mtcnn/mtcnn_256.json'
len(self.src_list): 1
Traceback (most recent call last):
File "pipeline.py", line 418, in
save_mask()
File "pipeline.py", line 328, in save_mask
dataset = Portrait('data/portrait')
File "/home/syedmobassir.hossain/DiffSwap/stable-diffusion-main/DiffSwap/utils/portrait.py", line 40, in init__
self.affine_thetas = json.load(open(f'{root}/affine_theta.json'))
FileNotFoundError: [Errno 2] No such file or directory: 'data/portrait/affine_theta.json'