<typeu'参数未知'

2024-04-23 17:09:01 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用以下代码:“https://github.com/LouisFoucard/MC_DCNN/blob/master/.ipynb_checkpoints/MultiChannel_DeepConvNet-checkpoint.ipynb

当我运行代码时,我得到一个错误:

TypeError: unsupported operand type(s) for +: 'dict_values' and 'list'

此错误与以下代码行有关:

train = theano.function(inps.values()+[target_values],cost, updates=updates)

我把这行改成:

^{pr2}$

这次我得到的错误是:

TypeError: Unknown parameter type:

看来Theano.功能不接受字典.值作为输入?在

谢谢


Tags: 代码httpsgithubmastercomtype错误mc
1条回答
网友
1楼 · 发布于 2024-04-23 17:09:01

似乎您正在尝试在Python3中运行一些Python2代码, 其中dict.values返回dictionary view object

解决方案非常简单-只需将您的dict.values包装在list中:

train = theano.function(list(inps.values())+[target_values], cost, updates=updates)

相关问题 更多 >