Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何修复此错误:需要以下参数:--in-path,--out-path_Python_Conda - Fatal编程技术网

Python 如何修复此错误:需要以下参数:--in-path,--out-path

Python 如何修复此错误:需要以下参数:--in-path,--out-path,python,conda,Python,Conda,这是错误消息 Hassans-MacBook-Pro-3:fast-style-transfer-master hassan$ python3 evaluate.py --checkpoint ./rain-princess.ckpt --in-path/Users/hassan/Downloads/fast-style-transfer-master--out-path ./output_image.jpg usage: evaluate.py [-h] --checkpoint CHECKP

这是错误消息

Hassans-MacBook-Pro-3:fast-style-transfer-master hassan$ python3 evaluate.py --checkpoint ./rain-princess.ckpt --in-path/Users/hassan/Downloads/fast-style-transfer-master--out-path ./output_image.jpg
usage: evaluate.py [-h] --checkpoint CHECKPOINT --in-path IN_PATH --out-path
                   OUT_PATH [--device DEVICE] [--batch-size BATCH_SIZE]
                   [--allow-different-dimensions]
evaluate.py: error: the following arguments are required: --in-path, --out-path
这是evaluate.py脚本的一部分,我只是在遵循一个教程,文件放置不正确

from __future__ import print_function
import sys
sys.path.insert(0, 'src')
import transform, numpy as np, vgg, pdb, os
import scipy.misc
import tensorflow as tf
from utils import save_img, get_img, exists, list_files
from argparse import ArgumentParser
from collections import defaultdict
import time
import json
import subprocess
import numpy
from moviepy.video.io.VideoFileClip import VideoFileClip
import moviepy.video.io.ffmpeg_writer as ffmpeg_writer

BATCH_SIZE = 4
DEVICE = '/gpu:0'


def ffwd_video(path_in, path_out, checkpoint_dir, device_t='/gpu:0', batch_size=4):
    video_clip = VideoFileClip(path_in, audio=False)
    video_writer = ffmpeg_writer.FFMPEG_VideoWriter(path_out, video_clip.size, video_clip.fps, codec="libx264",
                                                    preset="medium", bitrate="2000k",
                                                    audiofile=path_in, threads=None,
                                                    ffmpeg_params=None)

    g = tf.Graph()
    soft_config = tf.compat.v1.ConfigProto(allow_soft_placement=True)
    soft_config.gpu_options.allow_growth = True
    with g.as_default(), g.device(device_t), \
            tf.compat.v1.Session(config=soft_config) as sess:
        batch_shape = (batch_size, video_clip.size[1], video_clip.size[0], 3)
        img_placeholder = tf.compat.v1.placeholder(tf.float32, shape=batch_shape,
                                         name='img_placeholder')

        preds = transform.net(img_placeholder)
        saver = tf.compat.v1.train.Saver()
        if os.path.isdir(checkpoint_dir):
            ckpt = tf.train.get_checkpoint_state(checkpoint_dir)
            if ckpt and ckpt.model_checkpoint_path:
                saver.restore(sess, ckpt.model_checkpoint_path)
            else:
                raise Exception("No checkpoint found...")
        else:
            saver.restore(sess, checkpoint_dir)

非常感谢你愿意帮忙 非常感谢你愿意帮忙
非常感谢您愿意帮助

此错误来自程序
evaluate.py
本身,这显然是您编写或下载的内容,因此我们无法在不看到它的情况下回答。然而,仅从错误消息来看

the following arguments are required: --in-path, --out-path
我注意到在您的命令行中

python3 evaluate.py --checkpoint ./rain-princess.ckpt --in-path/Users/hassan/Downloads/fast-style-transfer-master--out-path ./output_image.jpg
这两个选项都没有,因为
--in-path
和它的参数之间没有空格,这个文件名和
--out-path
之间也没有空格。所以我试着把这个改成

python3 evaluate.py --checkpoint ./rain-princess.ckpt --in-path /Users/hassan/Downloads/fast-style-transfer-master --out-path ./output_image.jpg
看看这是否能推动事情的发展


如果这还不能解决问题,我们需要一些上下文来说明什么是
evaluate.py

Hi@sj,欢迎来到我们的社区!你能不能编辑一下你的问题,详细解释一下,给我们更多的细节和背景?