Skip to content

Commit ef93c02

Browse files
author
wabywang(王本友)
committed
pickle_python_2_#
1 parent 661a1cc commit ef93c02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dataHelper.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@
88
from tqdm import tqdm
99
import random
1010
import time
11-
import pickle
1211
from utils import log_time_delta
1312
from tqdm import tqdm
1413
from dataloader import Dataset
1514
import torch
1615
from torch.autograd import Variable
1716
from codecs import open
18-
17+
try:
18+
import cPickle as pickle
19+
except ImportError:
20+
import pickle
1921
class Alphabet(dict):
2022
def __init__(self, start_feature_id = 1, alphabet_type="text"):
2123
self.fid = start_feature_id

0 commit comments

Comments
 (0)