Fix bug inside boston.py in boosted_trees with python 3
This fix tries to address the issue raised in 20776 where
run the sample with boston.py in boosted_trees throws out error
with python 3:
```
$ python3 boston.py \
> --batch_size=404 --output_dir="/tmp/boston" --depth=4 --learning_rate=0.1 \
> --num_eval_steps=1 --num_trees=500 --l2=0.001 \
> --vmodule=training_ops=1
......
......
Traceback (most recent call last):
File "boston.py", line 169, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
......
...... File "/usr/lib/python3.5/genericpath.py", line 145, in _check_arg_types
raise TypeError("Can't mix strings and bytes in path components") from None
TypeError: Can't mix strings and bytes in path components
```
The reason for the error was because in python 3, the
export_dir was returned as bytes.
This fix as the `compat.as_bytes` which is consistent
with other places in tensorflow.
This fix fixes 20776
Signed-off-by:
Yong Tang <yong.tang.github@outlook.com>
Loading
Please sign in to comment