🌐
Stack Overflow
stackoverflow.com › questions › 43299457 › attributeerror-nonetype-object-has-no-attribute-shape-resizing-image
python - AttributeError: 'NoneType' object has no attribute 'shape' resizing image - Stack Overflow
April 9, 2017 - import cv2 # Open de beeldfile image = cv2.imread("/fullPathImageName.jpg") # Bepaal afmetingen en aantal kleurkanalen width = image.shape[1] height = image.shape[0] colors = image.shape[2] print ("{} pixels breed".format(width)) print ("{} pixels hoog".format(height)) print ("{} kleur kanalen".format(colors)) img = cv2.resize(image, (512, 512)) width = img.shape[1] height = img.shape[0] colors = img.shape[2] print ("{} pixels breed".format(width)) print ("{} pixels hoog".format(height)) print ("{} kleur kanalen".format(colors))
🌐
GitHub
github.com › chenfei-wu › TaskMatrix › issues › 211
Remove Something From The Photo, 'NoneType' object has no attribute 'resize' · Issue #211 · chenfei-wu/TaskMatrix
March 16, 2023 - Remove Something From The Photo, 'NoneType' object has no attribute 'resize'#211 · Copy link · JihadAKl · opened · on Mar 16, 2023 · Issue body actions · I am using python visual_chatgpt.py --load "ImageCaptioning_cuda:0,ImageEditing_cuda:0,Text2Image_cuda:0" I am getting this error any idea?
Author   JihadAKl
Discussions

AttributeError: 'NoneType' object has no attribute 'shape'
Traceback (most recent call last): ...t/celeba_wild_dataset.py", line 117, in getitem label = cv2.resize(label, (image.shape[1], image.shape[0]), interpolation = cv2.INTER_LINEAR) AttributeError: 'NoneType' object has no attribute 'shape'... More on github.com
🌐 github.com
4
July 24, 2019
'NoneType' object has no attribute 'size'
() 12 #logit_mask = torch.unsqueeze(image, dim=0) 13 #logit_mask = imag... More on discuss.pytorch.org
🌐 discuss.pytorch.org
0
0
June 17, 2023
'NoneType' object has no attribute 'reshape' error when using ReActor node
Try Google too More on reddit.com
🌐 r/comfyui
20
0
April 14, 2025
python - Scale and Save Images (AttributeError: 'NoneType' object has no attribute 'shape') - Stack Overflow
224 How to resize an image with OpenCV2.0 and Python2.6 · 1 AttributeError: 'NoneType' object has no attribute 'shape' More on stackoverflow.com
🌐 stackoverflow.com
October 15, 2018
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
AttributeError: 'NoneType' object has no attribute 'shape' - Raspberry Pi Forums
(venv) cheeyong@raspberrypi:~ $ python3 /home/cheeyong/github1.py pygame 2.5.2 (SDL 2.28.3, Python 3.11.2) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "/home/cheeyong/github1.py", line 35, in <module> frame = imutils.resize(frame, width=900) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/cheeyong/venv/lib/python3.11/site-packages/imutils/convenience.py", line 69, in resize (h, w) = image.shape[:2] ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'shape' (venv) cheeyong@raspberrypi:~ $ I have totally no idea for this, but I can provide my code here, not sure it contain any error or not.
🌐
GitHub
github.com › NVlabs › SCOPS › issues › 4
AttributeError: 'NoneType' object has no attribute 'shape' · Issue #4 · NVlabs/SCOPS
July 24, 2019 - Traceback (most recent call last): ...t/celeba_wild_dataset.py", line 117, in getitem label = cv2.resize(label, (image.shape[1], image.shape[0]), interpolation = cv2.INTER_LINEAR) AttributeError: 'NoneType' object has no attribute 'shape'...
Author   PierfrancescoArdino
🌐
OpenCV Q&A Forum
answers.opencv.org › question › 209433 › attributeerror-nonetype-object-has-no-attribute-shape
AttributeError: 'NoneType' object has no attribute 'shape' - OpenCV Q&A Forum
import numpy as np import cv2 cap = cv2.VideoCapture('C:\Sample3.mp4') def rescale_frame(frame, percent=30): width = int(frame.shape[1] * percent/ 100) height = int(frame.shape[0] * percent/ 100) dim = (width, height) return cv2.resize(frame, dim, interpolation =cv2.INTER_AREA) while True: ret ,frame = cap.read() if type(frame) == type(None): break frame25 = rescale_frame(frame, percent=25) cv2.imshow('frame25',frame25) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()
🌐
Reddit
reddit.com › r/comfyui › 'nonetype' object has no attribute 'reshape' error when using reactor node
r/comfyui on Reddit: 'NoneType' object has no attribute 'reshape' error when using ReActor node
April 14, 2025 -

hello, i am relatively new to comfyui and found this ReActor node to swap faces. I tried it and got this error: NoneType object has no attribute reshape. I realy dont know how to fix this. I have reinstalled the ReActor node several times but nothing helped. I checked the dependencies and made sure everything is installed. I googled the error but found nothing. Please help. I am stuck at this for 2 weeks now.

[ReActor] 12:22:51 - STATUS - Checking for any unsafe content

[ReActor] 12:22:52 - STATUS - Working: source face index [0], target face index [0]

[ReActor] 12:22:52 - STATUS - Using Hashed Source Face(s) Model...

[ReActor] 12:22:52 - STATUS - Using Hashed Target Face(s) Model...

[ReActor] 12:22:52 - STATUS - Swapping...

!!! Exception during processing !!! 'NoneType' object has no attribute 'reshape'

Traceback (most recent call last):

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 345, in execute

output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 220, in get_output_data

return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 192, in _map_node_over_list

process_inputs(input_dict, i)

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 181, in process_inputs

results.append(getattr(obj, func)(**inputs))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\nodes.py", line 373, in execute

script.process(

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\scripts\reactor_faceswap.py", line 109, in process

result = swap_face(

^^^^^^^^^^

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-ReActor\scripts\reactor_swapper.py", line 362, in swap_face

result = face_swapper.get(result, target_face, source_face)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "D:\Programme\ComfyUI\ComfyUI_windows_portable\python_embeded\Lib\site-packages\insightface\model_zoo\inswapper.py", line 50, in get

latent = source_face.normed_embedding.reshape((1,-1))

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

AttributeError: 'NoneType' object has no attribute 'reshape'

Prompt executed in 0.54 seconds

This the consol log. I also looked in the files and asked Chatgpt but i couldnt find the problem.

🌐
Reddit
reddit.com › r/stablediffusion › attributeerror: 'nonetype' object has no attribute 'batch_size'
r/StableDiffusion on Reddit: AttributeError: 'NoneType' object has no attribute 'batch_size'
April 14, 2024 -

***Fixed the error below by replacing the motion_module.py file located under "Stable AI\stable-diffusion-webui\extensions\sd-webui-animatediff" with the file on this link here https://github.com/camenduru/webui-animatediff/blob/master/motion_module.py **

I have seen fixes for the "NoneType" error but this " AttributeError: 'NoneType' object has no attribute 'batch_size' " I cannot resolve. It will generate fine using txttoimg but as soon as I enable AnimatedDiff and choose generate I get the error. I have tried different motion models, other creator suggested settings with no avail. I have uninstalled and reinstalled and I know its gotta be something simple. Any suggestions would be appreciated. Rather new to Stable Diffusion, usually pretty resourcful but here I am.

**Additional information**

In the A1111 WebUi terminal I see the following when trying to execute .

"stable-diffusion-webui\extensions\sd-webui-animatediff\motion_module.py", line 334, in forward

video_length = mm_animatediff.ad_params.batch_size

AttributeError: 'NoneType' object has no attribute 'batch_size'

Looking at motion_module.py line 334 is "video_length = mm_animatediff.ad_params.batch_size"

I tried different number of frames as at a glance it appears to be a video length issue?

Find elsewhere
🌐
GitHub
github.com › jdf › Processing.py-Bugs › issues › 230
nonetype error · Issue #230 · jdf/Processing.py-Bugs
May 30, 2018 - I was creating a program with multiple images and it was working fine then i opened it on another computer and I keep getting a nonetype object has no attribute resize. This is my code, Im very lost. Thank you size(800,800) global deadpo...
🌐
GitHub
github.com › pytorch › pytorch › issues › 5588
AttributeError: 'NoneType' object has no attribute 'size' · Issue #5588 · pytorch/pytorch
March 6, 2018 - Use nn.Upsample instead.") 2018-03-06 ... 11, in forward 2018-03-06 01:11:15 PST b, c = input.size(0), input.size(1) 2018-03-06 01:11:15 PST AttributeError: 'NoneType' object has no attribute 'size' 2018-03-06 01:11:20 PST...
Author   starhopp3r
🌐
GitHub
github.com › Gourieff › ComfyUI-ReActor › issues › 104
[SOLVED] 'NoneType' object has no attribute 'reshape' · Issue #104 · Gourieff/ComfyUI-ReActor
April 14, 2025 - 'NoneType' object has no attribute 'reshape' Traceback (most recent call last): File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 345, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Programme\ComfyUI\ComfyUI_windows_portable\ComfyUI\execution.py", line 220, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTI
Author   User36737288
🌐
GitHub
github.com › comfyanonymous › ComfyUI › issues › 3931
Exception during processing!!! 'NoneType' object has no ...
July 3, 2024 - 2024-07-03 01:59:42,163- root:179- ERROR- !!! Exception during processing!!! 'NoneType' object has no attribute 'size'
Author   zhenyuanzhou
🌐
GitHub
github.com › PyImageSearch › imutils › issues › 44
'NoneType' object has no attribute 'shape' · Issue #44 · PyImageSearch/imutils
January 11, 2018 - Traceback (most recent call last): File "real_time_object_detection.py", line 44, in frame = imutils.resize(frame, width=400) File "C:\Anaconda3\lib\site-packages\imutils\convenience.py", line 69, in resize (h, w) = image.shape[:2] AttributeError: 'NoneType' object has no attribute 'shape' the code is: ·
Author   HeXu1
🌐
GitHub
github.com › kernc › backtesting.py › issues › 342
Implementing a new Custom Indicator: AttributeError: 'NoneType' object has no attribute 'size' and · Issue #342 · kernc/backtesting.py
May 5, 2021 - Traceback (most recent call last): ...thon\Python37\site-packages\pandas_ta\overlap\supertrend.py", line 20, in supertrend m = close.size AttributeError: 'NoneType' object has no attribute 'size'...
Author   windowshopr
🌐
Hugging Face
huggingface.co › BAAI › bge-m3 › discussions › 43
BAAI/bge-m3 · Got this error: AttributeError: 'NoneType' object has no attribute 'size'
April 9, 2024 - torchrun --nproc_per_node {number of gpus} \ -m FlagEmbedding.BGE_M3.run \ --output_dir {path to save model} \ --model_name_or_path BAAI/bge-m3 \ --train_data ./toy_train_data \ --learning_rate 1e-5 \ --fp16 \ --num_train_epochs 5 \ --per_device_train_batch_size {large batch size; set 1 for toy data} \ --dataloader_drop_last True \ --normlized True \ --temperature 0.02 \ --query_max_len 64 \ --passage_max_len 256 \ --train_group_size 2 \ --logging_steps 10 \ --same_task_within_batch True \ --unified_finetuning False \ --use_self_distill False · I set unified_finetuning and use_self_distill to False and got this error: File ". /modeling.py", line 262, in forward. targets = idxs * (p_sparse_vecs.size(0) // q_sparse_vecs.size(0)) AttributeError: 'NoneType' object has no attribute 'size'
🌐
Hugging Face
discuss.huggingface.co › beginners
Error: AttributeError: 'NoneType' object has no attribute 'shape' when prompt tuning with Chatglm2 - Beginners - Hugging Face Forums
October 9, 2023 - I modified simple code of peft to train chatglm2-6b witn prompt-tuning. Below is my code: from transformers import AutoModelForCausalLM from peft import get_peft_config, get_peft_model, PromptTuningInit, PromptTuningConfig, TaskType, PeftType import torch from datasets import load_dataset import ...
🌐
Reddit
reddit.com › r/stablediffusion › 'nonetype' object has no attribute 'lower'
r/StableDiffusion on Reddit: 'NoneType' object has no attribute 'lower'
December 19, 2023 -

I'm trying to use an upscaler and I keep getting this message any time my workflow get to the upscaling part(id odes the same if I try using control net):

Error occurred when executing UpscaleModelLoader: 'NoneType' object has no attribute 'lower' File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute output_data, output_ui = get_output_data(obj, input_data_all) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list results.append(getattr(obj, func)(**slice_dict(input_data_all, i))) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI\ComfyUI_windows_portable\ComfyUI\comfy_extras\nodes_upscale_model.py", line 20, in load_model sd = comfy.utils.load_torch_file(model_path, safe_load=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\AI\ComfyUI_windows_portable\ComfyUI\comfy\utils.py", line 12, in load_torch_file if ckpt.lower().endswith(".safetensors"): ^^^^^^^^^^

*please help in on a time crunch

🌐
Streamlit
discuss.streamlit.io › using streamlit
AttributeError: 'NoneType' object has no attribute 'update' - Using Streamlit - Streamlit
March 21, 2022 - Trying to create a web app using streamlit and fastai, I get the following error when I click on “classify.” ***AttributeError: 'NoneType' object has no attribute 'update'*** Weirdly enough, I tried the exact same met…