natethegreate / hent-AI

Automation of censor bar detection
MIT License
1.58k stars 145 forks source link

Fixes to work with python 3.9.6; #42

Closed loadingpt closed 1 year ago

loadingpt commented 2 years ago

Skips if frame already exists (to pause process or redo frame); Uncomment detector.py:20 - Force CPU mode;

Kamilowaty122 commented 2 years ago

When using this branch detection doesn't work properly. It either doesn't generate any output (image IS generated but no green on images) or on images there are random green lines that have nothing to do with censor.

It happens on both cpu and gpu.

Using official exe works properly.

Any ideas what could I be doing wrong?

EDIT: forgot to add logs. oops

PS E:\Wszytko\bo tak\Private\DeepCreamPy\hent-ai 1.6.9\hent-AI-master fork> py .\main.py WARNING:tensorflow:From C:\Users\kamiil\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\compat\v2_compat.py:107: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term WARNING:tensorflow:From C:\Users\kamiil\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\util\dispatch.py:1082: calling crop_and_resize_v1 (from tensorflow.python.ops.image_ops_impl) with box_ind is deprecated and will be removed in a future version. Instructions for updating: box_ind is deprecated, use box_indices instead WARNING:tensorflow:From C:\Users\kamiil\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\autograph\impl\api.py:458: calling map_fn (from tensorflow.python.ops.map_fn) with dtype is deprecated and will be removed in a future version. Instructions for updating: Use fn_output_signature instead WARNING:tensorflow:From C:\Users\kamiil\AppData\Local\Programs\Python\Python39\lib\site-packages\tensorflow\python\util\dispatch.py:1082: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version. Instructions for updating: Use tf.cast instead. WARNING:tensorflow:From E:\Wszytko\bo tak\Private\DeepCreamPy\hent-ai 1.6.9\hent-AI-master fork\mrcnn\model.py:2728: is_gpu_available (from tensorflow.python.framework.test_util) is deprecated and will be removed in a future version. Instructions for updating: Use tf.config.list_physical_devices('GPU') instead. 2022-06-21 21:38:20.223886: 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: AVX AVX2 To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-21 21:38:20.590248: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /device:GPU:0 with 2813 MB memory: -> device: 0, name: NVIDIA GeForce GTX 960, pci bus id: 0000:2b:00.0, compute capability: 5.2 CUDA-compatible GPU located! copying inputs into input_original dcp folder Running detection, outputting to dcp input Creating model, Loading weights... 2022-06-21 21:38:38.494318: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 2813 MB memory: -> device: 0, name: NVIDIA GeForce GTX 960, pci bus id: 0000:2b:00.0, compute capability: 5.2 2022-06-21 21:38:38.633224: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:354] MLIR V1 optimization pass is not enabled Weights loaded Will expand each mask by 4.0 pixels C:\Users\kamiil\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\engine\training_v1.py:2067: UserWarning: Model.state_updates will be removed in a future version. This property should not be used in TensorFlow 2.0, as updates are applied automatically. updates=self.state_updates, 2022-06-21 21:38:40.004323: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1532] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 2813 MB memory: -> device: 0, name: NVIDIA GeForce GTX 960, pci bus id: 0000:2b:00.0, compute capability: 5.2 2022-06-21 21:38:42.966933: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -317 } dim { size: -318 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -19 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -19 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 7 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -19 } dim { size: 7 } dim { size: 7 } dim { size: 256 } } } 2022-06-21 21:38:42.978061: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -307 } dim { size: -308 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -22 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -22 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 7 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -22 } dim { size: 7 } dim { size: 7 } dim { size: 256 } } } 2022-06-21 21:38:42.989070: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -295 } dim { size: -296 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -24 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -24 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 7 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -24 } dim { size: 7 } dim { size: 7 } dim { size: 256 } } } 2022-06-21 21:38:43.000099: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -281 } dim { size: -282 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -26 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -26 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 7 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -26 } dim { size: 7 } dim { size: 7 } dim { size: 256 } } } 2022-06-21 21:38:43.014846: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -317 } dim { size: -318 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -41 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -41 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 14 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -41 } dim { size: 14 } dim { size: 14 } dim { size: 256 } } } 2022-06-21 21:38:43.025958: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -307 } dim { size: -308 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -43 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -43 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 14 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -43 } dim { size: 14 } dim { size: 14 } dim { size: 256 } } } 2022-06-21 21:38:43.038919: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -295 } dim { size: -296 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -45 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -45 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 14 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -45 } dim { size: 14 } dim { size: 14 } dim { size: 256 } } } 2022-06-21 21:38:43.052135: W tensorflow/core/grappler/costs/op_level_cost_estimator.cc:690] Error in PredictCost() for the op: op: "CropAndResize" attr { key: "T" value { type: DT_FLOAT } } attr { key: "extrapolation_value" value { f: 0 } } attr { key: "method" value { s: "bilinear" } } inputs { dtype: DT_FLOAT shape { dim { size: -57 } dim { size: -281 } dim { size: -282 } dim { size: 256 } } } inputs { dtype: DT_FLOAT shape { dim { size: -47 } dim { size: 4 } } } inputs { dtype: DT_INT32 shape { dim { size: -47 } } } inputs { dtype: DT_INT32 shape { dim { size: 2 } } value { dtype: DT_INT32 tensor_shape { dim { size: 2 } } int_val: 14 } } device { type: "GPU" vendor: "NVIDIA" model: "NVIDIA GeForce GTX 960" frequency: 1253 num_cores: 8 environment { key: "architecture" value: "5.2" } environment { key: "cuda" value: "11020" } environment { key: "cudnn" value: "8100" } num_registers: 65536 l1_cache_size: 24576 l2_cache_size: 1048576 shared_memory_size_per_multiprocessor: 98304 memory_size: 2949749145 bandwidth: 112160000 } outputs { dtype: DT_FLOAT shape { dim { size: -47 } dim { size: 14 } dim { size: 14 } dim { size: 256 } } } 2022-06-21 21:38:43.713252: I tensorflow/stream_executor/cuda/cuda_dnn.cc:384] Loaded cuDNN version 8401 2022-06-21 21:38:44.431753: W tensorflow/core/common_runtime/bfc_allocator.cc:290] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.06GiB with freed_by_count=0. The caller indicates that this is not a failure, but this may mean that there could be performance gains if more memory were available. 2022-06-21 21:38:45.284363: W tensorflow/core/common_runtime/bfc_allocator.cc:290] Allocator (GPU_0_bfc) ran out of memory trying to allocate 2.09GiB with freed_by_count=0. The caller indicates that this is not a failure, but this may mean that there could be performance gains if more memory were available. 2022-06-21 21:38:47.811009: W tensorflow/core/common_runtime/bfc_allocator.cc:290] Allocator (GPU_0_bfc) ran out of memory trying to allocate 3.29GiB with freed_by_count=0. The caller indicates that this is not a failure, but this may mean that there could be performance gains if more memory were available. 2022-06-21 21:38:47.839313: W tensorflow/core/common_runtime/bfc_allocator.cc:290] Allocator (GPU_0_bfc) ran out of memory trying to allocate 1.78GiB with freed_by_count=0. The caller indicates that this is not a failure, but this may mean that there could be performance gains if more memory were available. Detection on image 0 of 6 finished in 12.5314 seconds Detection on image 1 of 6 finished in 3.1511 seconds Detection on image 2 of 6 finished in 1.8735 seconds Detection on image 3 of 6 finished in 1.3838 seconds Detection on image 4 of 6 finished in 1.8055 seconds Detection on image 5 of 6 finished in 2.3289 seconds Model unload successful! Process complete!

loadingpt commented 2 years ago

The warnings that you're getting is due to insufficient memory in your graphics cards, that probably isn't worrisome, can ignore it for majority of cases, The others are some tensorflow depricated code. But It not working its not your fault, I'm still trying to figure it out, might have to give up on using recent versions of python for this project, and install Python 3.5.2

The exe works because it was created using older python versions