You can convert your list to a numpy array and then reshape it with numpy.reshape

import numpy as np

# Convert to numpy array
w_train = np.array(w_train)
w_test = np.array(w_train)

# Reshape
w_train = np.reshape(w_train, (2404,28,224,224,3))
w_test = np.reshape(w_test, (601,28,224,224,3))
Answer from MD Mushfirat Mohaimin on Stack Overflow
Discussions

C5W2 Emojify Cell #14. Can't compile the student's code. Error: AttributeError("'list' object has no attribute 'reshape'",)
All tests are passed, but got 0 point. Can’t compile the student’s code. Error: AttributeError("‘list’ object has no attribute ‘reshape’",) More on community.deeplearning.ai
🌐 community.deeplearning.ai
0
0
May 25, 2021
Seeing AttributeError: 'Dataset' object has no attribute 'reshape' when using "dataset.get_nearest_examples"
Hello, I am trying to use Faiss indexing for an image similarity application. However, I am seeing an Attribute Error. Here’s the code that I am trying # Loading dataset dataset = load_dataset("imagefolder", data_dir="/… More on discuss.huggingface.co
🌐 discuss.huggingface.co
0
0
June 25, 2023
python - 'list' object has no attribute 'reshape' - Stack Overflow
0 When i try to reshape, it gives me an error saying "TypeError: list indices must be integers or slices, not tuple" 2 "builtin_function_or_method' object has no attribute 'reshape'" what does this mean? More on stackoverflow.com
🌐 stackoverflow.com
python - 'list' object has no attribute 'shape' - Stack Overflow
list object in python does not have 'shape' attribute because 'shape' implies that all the columns (or rows) have equal length along certain dimension. Let's say list variable a has following properties: More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › apache › incubator-mxnet › issues › 13970
AttributeError: 'list' object has no attribute 'reshape' · Issue #13970 · apache/mxnet
January 23, 2019 - i have a error in this line of my code python: AttributeError: 'list' object has no attribute 'reshape' the code is def feedforward(x, W1, W2, b1, b2): z1=np.dot(W1, x.reshape(4,1))+b1 a1=relu(z1) z2=np.dot(W2, a1)+b2 a2=sigmoid(z2) retu...
Author   toufikoss
🌐
Python Forum
python-forum.io › thread-13879.html
'list' object has no attribute 'reshape'
November 4, 2018 - Hi All, I've just joined this forum, also new to Python, with background in other languages. I've been trying a small piece of code below using jupyter ipython in notebooks.azure.com, the error is coming from the last call for np.reshape function w...
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-list-object-has-no-attribute-shape
AttributeError: 'list' object has no attribute 'shape' | bobbyhadz
April 8, 2024 - The Python "AttributeError: 'list' object has no attribute 'reshape'" occurs when we try to call the reshape() method on a list.
🌐
Hugging Face
discuss.huggingface.co › 🤗datasets
Seeing AttributeError: 'Dataset' object has no attribute 'reshape' when using "dataset.get_nearest_examples" - 🤗Datasets - Hugging Face Forums
June 25, 2023 - Hello, I am trying to use Faiss indexing for an image similarity application. However, I am seeing an Attribute Error. Here’s the code that I am trying # Loading dataset dataset = load_dataset("imagefolder", data_dir="/data") # Pre processing images def transforms(examples): examples["image"] = [image.resize((384, 384)).convert("RGB") for image in examples["image"]] return examples # Applying the transform function to dataset dataset = dataset.map(transforms, batched=True, batch_size=...
Find elsewhere
🌐
Data Science Learner
datasciencelearner.com › home › attributeerror : ‘list’ object has no attribute ‘reshape’ ( solved )
AttributeError : 'list' object has no attribute 'reshape' ( Solved )
February 12, 2023 - For example, you can convert the ... object has no attribute “reshape” error is that the list does not has the reshape() function to change the dimensions....
🌐
GitHub
github.com › ManimCommunity › manim › issues › 3617
"AttributeError: 'list' object has no attribute 'reshape'" when use OpenGL renderer to transform a math LaTeX formula to another · Issue #3617 · ManimCommunity/manim
February 13, 2024 - "AttributeError: 'list' object has no attribute 'reshape'" when use OpenGL renderer to transform a math LaTeX formula to another #3617
Author   monusw
🌐
GitHub
github.com › pandas-dev › pandas › issues › 35731
BUG: Series has no attribute "reshape" after adding a new category in df · Issue #35731 · pandas-dev/pandas
August 14, 2020 - -> 2747 values = values.reshape(tuple((1,) + shape)) # type: ignore 2748 return values 2749 ~/.pyenv/versions/3.7.0/envs/fair_ml/lib/python3.7/site-packages/pandas/core/generic.py in __getattr__(self, name) 5128 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5129 return self[name] -> 5130 return object.__getattribute__(self, name) 5131 5132 def __setattr__(self, name: str, value) -> None: AttributeError: 'Series' object has no attribute 'reshape'
Author   chen-bowen
🌐
Experts Exchange
experts-exchange.com › questions › 27146878 › AttributeError-'list'-object-has-no-attribute-'shape'-Python.html
Solved: AttributeError: 'list' object has no attribute 'shape': Python | Experts Exchange
June 28, 2011 - The third parameter, Z0, is apparently expected to be some object that has a property called "shape", while you are passing it an array. I also don't understand why you assign to Z0 twice. The second assignment wipes out the first. Perhaps the first assignment is the one you really want? ... Yes, sorry. The first ZO declaration works: Z0 = np.zeros([np.size(X,0),np. ... ,float) surf1 = ax.plot_surface(X, Y, Z0, rstride=1, cstride=1, cmap=cm.bwr,linewidth=0) This Z0 = [[-2,2,0,1],[2,0,-1,2],[0, ... ,-2,0,1]] does not.
🌐
Coder Legion
coderlegion.com › 367 › resolved-attributeerror-dataframe-object-has-no-attribute-reshape
Resolved: Attributeerror: 'dataframe' object has no attribute 'reshape' - Coder Legion
Encountering the `AttributeError 'DataFrame' object has no attribute 'reshape'` is common when using Pandas in Python. It happens due to the absence of the reshape attribute within the DataFrame class, especially during reshaping operations. ...
🌐
Reddit
reddit.com › r/learnpython › how to fix: pandas profiling (v 2.8) error: 'series' object has no attribute 'reshape'
r/learnpython on Reddit: How to fix: Pandas Profiling (v 2.8) Error: 'Series' object has no attribute 'reshape'
September 3, 2020 - -> 2744 values = values.reshape(tuple((1,) + shape)) # type: ignore 2745 return values 2746 ~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name) 5128 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5129 return self[name] -> 5130 return object.__getattribute__(self, name) 5131 5132 def __setattr__(self, name: str, value) -> None: AttributeError: 'Series' object has no attribute 'reshape' Pandas is 1.1 ·
🌐
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
🌐
PyTorch Forums
discuss.pytorch.org › t › attributeerror-list-object-has-no-attribute-shape › 124100
AttributeError: 'list' object has no attribute 'shape' - PyTorch Forums
June 14, 2021 - Based on the error messages it seems that feats is a list, while you are trying to use it as a tensor. You could thus make sure that the forward method of your model returns a tensor or convert the list to a tensor using e.g. torch.stack · Yes, Python lists don’t have the clone() or shape ...
🌐
Researchdatapod
researchdatapod.com › home › how to solve python attributeerror: ‘list’ object has no attribute ‘shape’
How to Solve Python AttributeError: ‘list’ object has no attribute ‘shape’ - The Research Scientist Pod
February 23, 2022 - AttributeError occurs in a Python ... object has no attribute ‘shape’” tells us that the list object we are handling does not have the shape attribute....
🌐
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.