使用Neurolab接收错误构建矢量量化器

时间:2018-07-02 02:02:32

标签: python neural-network artificial-intelligence neurolab

下面是我要执行的代码,以及我收到的以下错误消息。感谢您的提前帮助。

----> 6 nn = nl.net.newlvq(nl.tool.minmax(data),num_input_neurons,weights)

# Define a neural network with 2 layers: 
# 10 neurons in input layer and 4 neurons in output layer
num_input_neurons = 10
num_output_neurons = 4
weights = [1/num_output_neurons] * num_output_neurons
nn = nl.net.newlvq(nl.tool.minmax(data), num_input_neurons, weights)

我收到的错误:

TypeError: slice indices must be integers or None or have an __index__ method

1 个答案:

答案 0 :(得分:0)

https://blog.csdn.net/weixin_40592798/article/details/85678047

获得了它
  1. 转到:... \ Programs \ Python \ Python37-32 \ Lib \ site-packages \ neurolab或下载Neurolab软件包的任何地方。
  2. 打开net.py
  3. 转到第179行,然后将int()添加到两个位置。 Just like this.

这对我有用。