主要是为了跑通Wide & Deep Learning。
环境:
1. data_download.py:
temp_file, _ = urllib.request.urlretrieve(url)
更改为:
temp_file = url # url为本地文件路径
DATA_URL = '/tmp/census_data/adult'
TRAINING_FILE = 'adult.data'
TRAINING_URL = '%s/%s'
EVAL_FILE = 'adult.test'
EVAL_URL = '%s/%s'
2. wide_deep.py:
遇到的 bug , 报错信息:
tensorflow.python.framework.errors_impl.InvalidArgumentError: Expect 15 fields but have 14 in record 0
![这里写图片描述](https://img-blog.csdn.net/20171126180211382?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSGVsbG9KRlM=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
原因:
- 数据格式问题,含有空格,丢失,分隔符不对等
![这里写图片描述](https://img-blog.csdn.net/20171126180502519?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvSGVsbG9KRlM=/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
处理
删除不合理的即可。