在调试 《Outer Product-based Neural Collaborative Filtering》论文的源码(https://github.com/duxy-me/ConvNCF )时,出现的问题:

即使修改成与下一行一样的 _dataset(前面加了下划线),依然不行…,还报了新的错误……

是因为dataset 没有被初始化吗??。。。然而,数据是可以加载的……

debug一下,数据也是有的:

_dataset 也是有数据的:

最后的最后……,解决办法是:修改如下:

(可能的原因在于,python 2.0 与python 3.0 的map函数在使用上有所区别…:https://www.cnblogs.com/blackeyes1023/p/10954243.html

源码的运行环境:(它的Python是2.0 。而我的Pycharm是装的 python 3.0 ,并且TensorFlow是1.14.0)

修改如下:

即可运行成功

Debug 路漫漫-15:Python: NameError:name 'dataset' is not defined的更多相关文章

  1. Debug 路漫漫-05

    Debug 路漫漫-05: 1.使用这种方式计算 AUC 指标,结果出来居然是 NAN, —— 分母为(M*N),M或者N必有一个为0 了.(nan出现的情况绝大部分是分母出现0了)   若分子为0的 ...

  2. Debug 路漫漫-03

    Debug 路漫漫-03:SVD++的 Matlab 版本 SVD++ 的 pu 这一项: 圈圈中的这一项,它既然要和pu 相加 的话 ,那么,它的维度也应该是 m*K.(就是维度和Pu一致的 . 而 ...

  3. paip.python NameError name 'xxx' is not defined\

    paip.python NameError name 'xxx' is not defined\ 导入一个另一个文件里面的函数的时候儿,出孪这个err #这个仅仅导入孪file...要使用里面的fun ...

  4. python NameError: name 'file' is not defined

    import sys import time import os poem='''\ 测试读写文件 ''' print(os.getcwd()) f=file(os.getcwd()+'/python ...

  5. python NameError: name 'raw_input' is not defined

    错误:NameError: name 'raw_input' is not defined 原因出在raw_input ,python3.0版本后用input替换了raw_input 话说回来,学习p ...

  6. Debug 路漫漫-13:Python: pandas IndexError: single positional indexer is out-of-bounds

    在数据预处理过程中,出现:IndexError: single positional indexer is out-of-bounds 原因是在使用 Pandas 读取 dataframe 的时候,分 ...

  7. Debug 路漫漫-11:Python: TypeError: 'generator' object is not subscriptable

    调试程序,出现以下错误: Python: TypeError: 'generator' object is not subscriptable “在Python中,这种一边循环一边计算的机制,称为生成 ...

  8. Debug 路漫漫-14:Python: AttributeError: module 'tensorflow' has no attribute 'sub'

    在调试 <Neural Factorization Machines for Sparse Predictive Analytics>论文的源码(https://github.com/he ...

  9. Debug 路漫漫-12:Python: ValueError: 'userid' is both an index level and a column label, which is ambiguous.

    啊,又遇到难题了 == 想要对两个 dataframe 做自然连接 merge,连接的key 为 “userid”,但是报错:ValueError: 'userid' is both an index ...

随机推荐

  1. Kettle在windows上安装

    Kettle是一款国外开源的ETL工具,纯java编写,可以在Windows.Linux.Unix上运行,数据抽取高效稳定. 因为有个日常提数,工作日每天都要从数据库中提取数据,转换为excel,再以 ...

  2. Linux目录结构-下部

    第1章 /etc目录 1.1 /etc/inittab 1.1.1 查看当前系统的运行级别 [root@nfsnobody ~]# runlevel N 3##查看系统当前运行级别 后面的数字表示当前 ...

  3. 对并发Map的测试

    /** * ConcurrentHashMap效率最高 */ public class MapTest { public static void main(String[] args) throws ...

  4. Vue修改单个组件的背景颜色

    组件默认背景颜色为白色,但工作需要改成黑色,于是研究了一番. 很简单,只需在组件中使用两个钩子函数beforeCreate (),beforeDestroy () 代码如下: beforeCreate ...

  5. 用Python进行数据清洗,这7种方法你一定要掌握

    前言 文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理. 作者 | 常国珍.赵仁乾.张秋剑 来源 |<Python数据科学:技术 ...

  6. String字符串工具类

    字符串类(StringUtil.cs) using System; namespace Sam.OA.Common { /// <summary> /// 字符处理工具类 /// 作者:陈 ...

  7. 推荐一下干货-------为什么你的app不耐看

    直接上链接: 为什么你的app不耐看(上)https://www.ui.cn/detail/339252.html 为什么你的app不耐看(下)https://www.ui.cn/detail/423 ...

  8. SwiftUI学习(二)

    教程 2 - Building Lists and Navigation Section 4 - Step 2: 静态 List var body: some View { List { Landma ...

  9. Bitbucket与git上传源码的使用方法

    本文链接:https://blog.csdn.net/nomisshe/article/details/19625555 Bitbucket使用方法   一.软件及SSH keys: 由于我的Bitb ...

  10. 学习51cto中美团中的小知识点--组件实现按需求加载

    1====>vue.20脚手架的创建 cnpm install --global vue-cli 全局安装脚手架 vue init webpack my-project 创建项目 Use ESL ...