below code is from github and i what to change it according to system path
with open("./output/cifar_inception_plot.pkl", 'rb') as f:
dat = pickle.load(f)
total_inception = dict({})
for item in dat:
allis = dat[item]
allis = [x[0] for x in allis]
total_inception[os.path.basename(item)] = np.array(allis)
when i tried to change it like code below:
with open("./Users/Amulya/Desktop/cifar_inception.pkl", 'rb') as f:
dat = pickle.load(f)
total_inception = dict({})
for item in dat:
allis = dat[item]
allis = [x[0] for x in allis]
total_inception[os.path.basename(item)] = np.array(allis)
i got error
--------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) in 77 } 78 ---> 79 with open("./Users/Amulya/Desktop/cifar_inception.pkl", 'rb') as f: 80 dat = pickle.load(f) 81 total_inception = dict({}) FileNotFoundError: [Errno 2] No such file or directory: './Users/Amulya/Desktop/cifar_inception.pkl'
iam still getting error any solution on how to write the filename corretly
If file is in the same directory as the python script you're running you can just use the name of the file itself
open("cifar_inception.pkl")
otherwise you can use various utils in the os library. Ultimately you need to know where the file is on your system and what the full path is, when in doubt use the full path from root assuming you're on Mac OS based on the path you provided it it might just be "/Users/Amulya/Desktop/cifar_inception.pkl".