Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x93 in position 0: invalid start byte #6

Open
eece-23 opened this issue Jun 12, 2019 · 5 comments

Comments

@eece-23
Copy link

eece-23 commented Jun 12, 2019

When I run
python ../argfile_runner.py runners/lottery_experiment.py argfiles/lottery_experiment_argfile.py
command,
The following ERROR reported:
Using TensorFlow backend.
WARNING:tensorflow:From /Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/foundations/save_restore.py:85: FastGFile.init (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
Traceback (most recent call last):
File "runners/lottery_experiment.py", line 31, in
main()
File "runners/lottery_experiment.py", line 27, in main
fire.Fire(lottery_experiment.train)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/mnist_fc/lottery_experiment.py", line 103, in train
presets=save_restore.standardize(presets))
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/foundations/experiment.py", line 61, in experiment
initial, final = train_once(0, presets=presets)
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/foundations/experiment.py", line 55, in train_once
dataset = make_dataset()
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/mnist_fc/lottery_experiment.py", line 71, in make_dataset
train_order_seed=train_order_seed)
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/datasets/dataset_mnist.py", line 41, in init
mnist = save_restore.restore_network(mnist_location)
File "/Volumes/other/a2/program/lottery-ticket-hypothesis/lottery_ticket/foundations/save_restore.py", line 86, in restore_network
weights_dict[name] = np.load(fp)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py", line 416, in load
magic = fid.read(N)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py", line 132, in read
pywrap_tensorflow.ReadFromStream(self._read_buf, length, status))
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/tensorflow/python/lib/io/file_io.py", line 100, in _prepare_value
return compat.as_str_any(val)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/compat.py", line 107, in as_str_any
return as_str(value)
File "/Volumes/other/a2/anaconda3/lib/python3.7/site-packages/tensorflow/python/util/compat.py", line 80, in as_text
return bytes_or_text.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x93 in position 0: invalid start byte

@FttFYQ
Copy link

FttFYQ commented Jun 13, 2019

I have the same problem.Do you solve it?

@momo1986
Copy link

momo1986 commented Jul 8, 2019

Met same problems to reproduce the code.

@joaolcaas
Copy link

I got the same here

@joaolcaas
Copy link

#4 alredy solve this problem.

@Yerin703
Copy link

Hi, I got that problem too.
I solved this problem by revising code.
In the file named 'save_restore.py',
in 87Line, "with tf.io.gfile.GFile(os.path.join(filename, basename)) as fp:"
I fixed to "with tf.io.gfile.GFile(os.path.join(filename, basename), 'rb') as fp:"

And it worked! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants