gpt4 book ai didi

python - 值错误 : cannot reshape array of size 30470400 into shape (50, 1104,104)

转载 作者:太空狗 更新时间:2023-10-29 22:05:24 26 4
gpt4 key购买 nike

我正在尝试运行这个教程 http://emmanuelle.github.io/segmentation-of-3-d-tomography-images-with-python-and-scikit-image.html

我想在其中使用 Python 对 3-D 断层扫描图像进行分割。

我一开始就在努力 reshape 图像。

这是代码:

%matplotlib inline

import numpy as np

import matplotlib.pyplot as plt

import time as time

data = np.fromfile('/data/data_l67/dalladas/Python3/Daten/Al8Cu_1000_g13_t4_200_250.vol', dtype=np.float32)

data.shape

(60940800,)

data.reshape((50,1104,104))

--------------------------------------------------------------------------- ValueError Traceback (most recent call last) in () ----> 1 data.reshape((50,1104,104))

ValueError: cannot reshape array of size 30470400 into shape (50,1104,104)

有人能帮帮我吗?

最佳答案

似乎有一个错字,因为 1104*1104*50=60940800 而您正在尝试 reshape 尺寸 50,1104,104。所以看来需要把104改成1104。

关于python - 值错误 : cannot reshape array of size 30470400 into shape (50, 1104,104),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42947298/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com