It means that somewhere a function which should return a image just returned None and therefore has no shape attribute. Try "print img" to check if your image is None or an actual numpy object.

Answer from asc11 on Stack Overflow
🌐
Reddit
reddit.com › r/stablediffusion › attributeerror: 'nonetype' object has no attribute 'shape'
r/StableDiffusion on Reddit: AttributeError: 'NoneType' object has no attribute 'shape'
October 18, 2023 -

I used the ControlNet extension & the Realistic Vision checkpoint, and it keeps giving me this error, "AttributeError: 'NoneType' object has no attribute 'shape'" whenever I try to generate a image. Even not using them, I still get this error.

What is the issue and how can I fix it?

Edit: it turns out when trying to use ControlNet, I was matching one of the preprocessors with the wrong models.

Discussions

NoneType' object has no attribute 'shape' problem
Your question This message keep showing when using any controlent node no matter what i do i try all suggested solutions like reinstall control net reinstall comfy change python version trying diff... More on github.com
🌐 github.com
6
January 24, 2025
machine learning - 'NoneType' object has no attribute 'get_shape' in standard AdamOptimizer Initialization - Data Science Stack Exchange
I'm trying to construct a basic neural network in TensorFlow by following an example in Hands-On Machine Learning by Aurelian. The following code n_inputs = 4 n_hidden = 4 n_outputs = 1 initializer... More on datascience.stackexchange.com
🌐 datascience.stackexchange.com
python - AttributeError: 'NoneType' object has no attribute 'shape' - Stack Overflow
1 AttributeError: 'NoneType' object has no attribute 'shape' / Convert from multiple contour box to singular More on stackoverflow.com
🌐 stackoverflow.com
Error: AttributeError: 'NoneType' object has no attribute 'shape' when prompt tuning with Chatglm2
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 ... More on discuss.huggingface.co
🌐 discuss.huggingface.co
0
0
October 9, 2023
🌐
Fast.ai
forums.fast.ai › part 1 (2018)
AttributeError: 'NoneType' object has no attribute 'shape' - Part 1 (2018) - fast.ai Course Forums
December 22, 2017 - My data is organised as: train:- containing folder for each class valid :- containing folder for each class test:- contains all test images [error]
🌐
GitHub
github.com › Comfy-Org › ComfyUI › issues › 6590
NoneType' object has no attribute 'shape' problem · Issue #6590 · Comfy-Org/ComfyUI
January 24, 2025 - Your question This message keep showing when using any controlent node no matter what i do i try all suggested solutions like reinstall control net reinstall comfy change python version trying different models try set union control net t...
Author   nadainterior
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › programming › python
AttributeError: 'NoneType' object has no attribute 'shape' - Raspberry Pi Forums
(venv) cheeyong@raspberrypi:~ $ ...env/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 ...
Find elsewhere
🌐
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()
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-nonetype-object-has-no-attribute-shape
AttributeError: 'NoneType' object has no attribute 'shape' | bobbyhadz
April 8, 2024 - The Python "AttributeError: 'NoneType' object has no attribute 'shape'" occurs when we access the shape attribute on a None value, e.g.
🌐
Quora
quora.com › How-do-you-resolve-the-read-file-error-nonetype-object-has-no-attribute-shape-python-file-development
How to resolve the read file error ''nonetype' object has no attribute 'shape'' (python, file, development) - Quora
Answer: In general, that error means that you have a variable that refers to None where you expect it to refer to an object that has an attribute “shape”. Look at the code that created that object; for instance, judging from your question, ...
🌐
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 ...
🌐
GitHub
github.com › ultralytics › yolov5 › issues › 6916
AttributeError: 'NoneType' object has no attribute 'shape'. · Issue #6916 · ultralytics/yolov5
March 9, 2022 - AttributeError: 'NoneType' object has no attribute 'shape'.#6916 · Copy link · Labels · StaleStale and schedule for closing soonStale and schedule for closing soon · Hrrsmjd · opened · on Mar 9, 2022 · Issue body actions · I am trying to get YOLOV5 (with --source 0) working on my Raspberry PI.
Author   Hrrsmjd
🌐
OpenCV
forum.opencv.org › t › attributeerror-nonetype-object-has-no-attribute-shape › 4910
AttributeError: 'NoneType' object has no attribute 'shape' - imgcodecs - OpenCV
August 24, 2021 - What is this error?? Traceback (most recent call last): File "code.py", line 1717, in shape height, width = input.shape AttributeError: 'NoneType' object has no attribute 'shape' This is the code: input…
🌐
GitHub
github.com › Mikubill › sd-webui-controlnet › issues › 110
Error: 'NoneType' object has no attribute 'shape' · Issue #110 · Mikubill/sd-webui-controlnet
February 16, 2023 - in txt2img tab have an error 'NoneType' object has no attribute 'shape' when try use control net with canny Error completing request Arguments: ('task(4xiu5obdiohh5gn)', 'a cat', '', [], 20, 0, False, False, 1, 1, 7, -1.0, -1.0, 0, 0, 0,...
Author   LexVolkov
🌐
Faceswap Forum
forum.faceswap.dev › forum home › support › training support
'NoneType' object has no attribute 'shape' - Faceswap Forum - The place to discuss Faceswap and Deepfakes
May 13, 2021 - All training images for each side must have the same dimensions. 05/14/2021 13:15:05 ERROR The batch that failed contains the following files: 05/14/2021 13:15:05 ERROR ['10_070801_0.png (1024px)', <class 'NoneType'>, '7_029351_0.png (1024px)', '12_011101_0.png (1024px)'].
🌐
GitHub
github.com › dennybritz › chatbot-retrieval › issues › 33
AttributeError: 'NoneType' object has no attribute 'get_shape' · Issue #33 · dennybritz/chatbot-retrieval
December 11, 2016 - AttributeError: 'NoneType' object has no attribute 'get_shape'#33 · Copy link · prithajnath · opened · on Dec 11, 2016 · Issue body actions · When I try to run python3 udc_predict.py --model_dir=runs/1481407347, I get the following error ·
🌐
PyTorch Forums
discuss.pytorch.org › t › nonetype-object-has-no-attribute-shape › 140895
NoneType' object has no attribute 'shape' - PyTorch Forums
January 5, 2022 - so this is my code sentence = tokenize(sentence) X = bag_of_words(sentence,all_words) X = X.reshape(1,X.shape[0]) X = torch.from_numpy(X).to(device) and this is the error given AttributeError: ‘NoneType’ object has no…