clean codedex warning

This commit is contained in:
hanjun996 2020-07-01 11:44:10 +08:00
parent 7b5b4837ff
commit 83c5505727
1 changed files with 11 additions and 4 deletions

View File

@ -17,6 +17,8 @@ import os
import pickle import pickle
import collections import collections
import argparse import argparse
import urllib.request
import tarfile
import numpy as np import numpy as np
from mindspore.mindrecord import FileWriter from mindspore.mindrecord import FileWriter
@ -257,10 +259,15 @@ if __name__ == '__main__':
download_data_path = data_path + "origin_data/" download_data_path = data_path + "origin_data/"
mkdir_path(download_data_path) mkdir_path(download_data_path)
os.system( url = "https://s3-eu-west-1.amazonaws.com/kaggle-display-advertising-challenge-dataset/dac.tar.gz"
"wget -P {} -c https://s3-eu-west-1.amazonaws.com/kaggle-display-advertising-challenge-dataset/dac.tar.gz --no-check-certificate".format( file_name = download_data_path + '/' + url.split('/')[-1]
download_data_path)) urllib.request.urlretrieve(url, filename=file_name)
os.system("tar -zxvf {}dac.tar.gz".format(download_data_path))
tar = tarfile.open(file_name)
names = tar.getnames()
for name in names:
tar.extract(name, path=download_data_path)
tar.close()
criteo_stats = CriteoStatsDict() criteo_stats = CriteoStatsDict()
data_file_path = data_path + "origin_data/train.txt" data_file_path = data_path + "origin_data/train.txt"