7 for i in range(m):
8 idx = record[i:] != 0
----> 9 rating_mean[i] = np.mean(rating[i,idx])
10 rating_norm[i,idx] -= rating_mean[i]
11 return rating_norm,rating_mean
IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed
8 idx = record[i:] != 0
----> 9 rating_mean[i] = np.mean(rating[i,idx])
10 rating_norm[i,idx] -= rating_mean[i]
11 return rating_norm,rating_mean
IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed
2021-05-13
最新回答 / 不会写代码的小郭i
2.0以上版本把代码改为:optimizer = tf.compat.v1.train.AdamOptimizer(1e-4)train = optimizer.minimize(loss)
2020-10-10
最新回答 / 慕函数8562618
# 需要将TensorFlow版本设置为1.x%tensorflow_version 1.ximport tensorflow as tftf.__version__
2020-06-29
最赞回答 / 奕帝传说_梦
summaryMerge=tf.compat.v1.summary.merge_all(); 用这个https://docs.google.com/spreadsheets/d/1FLFJLzg7WNP6JHODX5q8BDgptKafq_slHpnHVbJIteQ/edit#gid=0 遇到问题用上面的网址一个个对照过来——百度了三个小时才解决呜呜呜
2020-06-28