报错如下:
usage: ipykernel_launcher.py [-h] [--input [INPUT]]
[--label-input [LABEL_INPUT]] [--output [OUTPUT]]
[--dimensions DIMENSIONS] [--walk-step WALK_STEP]
[--num-walks NUM_WALKS]
[--window-size WINDOW_SIZE] [--iter ITER]
[--workers WORKERS] [--max-hop MAX_HOP]
[--weighted] [--unweighted] [--directed]
[--undirected]
ipykernel_launcher.py: error: unrecognized arguments: .....json
An exception has occurred, use %tb to see the full traceback.
SystemExit: 2
原因为Jupyter会读入一个默认的环境参数-f ;所以为了解决这个问题,我们可以手动移除或者忽略这个参数。
两个简单的solution:
Solution 1:
解决Jupyter Notebook运行Python程序外部参数错误

本文介绍了在Jupyter Notebook中遇到由于默认参数-f导致的运行Python程序错误,提供了解决此问题的两种方案:Solution 1和Solution 2,包括将parser.parse_args()替换为parser.parse_known_args()[0]。
最低0.47元/天 解锁文章
599





