【问题标题】:Dask compute command issuesDask 计算命令问题
【发布时间】:2021-09-10 22:59:46
【问题描述】:

我正在尝试将一些操作的结果放在一起以生成地震属性并将其与计算命令一起放入 dask 数据帧中,但它会生成以下错误:

AttributeError: 'NoneType' 对象没有属性 'array_wrap'

这是我正在使用的代码:

sys.path.append('./d2geo/attributes')

from d2geo.attributes.CompleTrace import ComplexAttributes
from d2geo.attributes.SignalProcess import SignalProcess

complex_att = ComplexAttributes()
signal_process = SignalProcess()

def amplitude_arr(input_cube):
    return da.from_array(input_cube)

# List of tuples with attribute name, the function 
# to run (with cube as input) and additional kwargs dict.
funcs = [
    ('Amplitude', amplitude_arr, {}),
    ('Envelope', complex_att.envelope, {}),
    ('Instantaneous Phase', complex_att.instantaneous_phase, {}),
    ('Instantaneous Frequency', complex_att.instantaneous_frequency, {}),
    ('Instantaneous Bandwidth', complex_att.instantaneous_bandwidth, {}),
    ('Dominant Frequency', complex_att.dominant_frequency, {}),
    ('Cosine Instantaneous Phase', complex_att.cosine_instantaneous_phase, {}),
    ('Second Derivative', signal_process.second_derivative, {}),
    ('Reflection Intensity', signal_process.reflection_intensity, {})
]

dataframe = run_attributes(cube, funcs).compute()
dataframe.tail()

【问题讨论】:

    标签: dask


    【解决方案1】:

    这似乎不一定是 Dask 问题。我相信这里发生的事情是在应用这些函数的过程中的某个地方,您最终得到了一个无变量,并且您试图访问属性array_wrap,这就是导致错误的原因。 更详细的解释可以查看Why do I get AttributeError: 'NoneType' object has no attribute 'something'?

    【讨论】:

    • 我只是再次运行程序并进行了一些修改,现在它给了我以下错误“MemoryError: Unable to allocate 467. MiB for an array with shape (213, 213, 1349) and data type float64 “它一直来自标识为数据框的代码行。这可能是什么原因造成的?
    猜你喜欢
    • 1970-01-01
    • 2022-10-12
    • 2016-08-25
    • 2019-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-26
    相关资源
    最近更新 更多