小编Luk*_*fer的帖子

pytube:AttributeError:“NoneType”对象没有属性“span”

我刚刚下载了 pytube(版本 11.0.1)并从这里开始使用以下代码片段:

from pytube import YouTube
YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()
Run Code Online (Sandbox Code Playgroud)

这给出了这个错误:

AttributeError                            Traceback (most recent call last)
<ipython-input-29-0bfa08b87614> in <module>
----> 1 YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()

~/anaconda3/lib/python3.8/site-packages/pytube/__main__.py in streams(self)
    290         """
    291         self.check_availability()
--> 292         return StreamQuery(self.fmt_streams)
    293 
    294     @property

~/anaconda3/lib/python3.8/site-packages/pytube/__main__.py in fmt_streams(self)
    175         # https://github.com/pytube/pytube/issues/1054
    176         try:
--> 177             extract.apply_signature(stream_manifest, self.vid_info, self.js)                                                                            
    178         except exceptions.ExtractError:
    179             # To force an update to the js file, we clear the cache and retry                                                                           

~/anaconda3/lib/python3.8/site-packages/pytube/extract.py in apply_signature(stream_manifest, vid_info, js)                                                     
    407 
    408     """
--> 409     cipher = …
Run Code Online (Sandbox Code Playgroud)

python attributeerror pytube

15
推荐指数
4
解决办法
2万
查看次数

如何使用带有预训练模型但缺少标签文件 (.pbtxt) 的 Tensorflows 对象检测模型动物园

我正在尝试运行 Tensorflow 对象检测。不幸的是,我发现 Tensorflow 的预训练模型都没有标签文件。我怎样才能得到这些文件?我想要做的就是测试几张图片的对象检测并显示标签。以下代码是我到目前为止所拥有的。不幸的是,几乎所有的教程都使用我没有的标签文件 (.pbtxt)。在 Tensorflow 的相应下载页面上,Tensorflow检测模型动物园说标签文件包含在下载中,但实际上没有。我下载了不同的模型。所有模型都没有标签文件。如果有人能帮助我,我将不胜感激。

到目前为止我的代码:

import tensorflow as tf
import cv2
import os

def get_frozen_graph(graph_file):
    """Read Frozen Graph file from disk."""
    with tf.gfile.FastGFile(graph_file, "rb") as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
    return graph_def

# The TensorRT inference graph file downloaded from Colab or your local machine.
pb_fname = os.path.join(os.getcwd(), "faster_rcnn_inception_resnet_v2_atrous_coco_2018_01_28", "frozen_inference_graph.pb")
trt_graph = get_frozen_graph(pb_fname)

input_names = ['image_tensor']

# Create session and load graph
tf_config = tf.ConfigProto()
tf_config.gpu_options.allow_growth = True
tf_sess = tf.Session(config=tf_config)
tf.import_graph_def(trt_graph, name='')

tf_input …
Run Code Online (Sandbox Code Playgroud)

python label tensorflow

3
推荐指数
1
解决办法
1511
查看次数

Kubernetes“日志”不显示在 pod 中的容器中运行的简单 python 程序的任何输出

我有一个非常简单的设置。我的 Kubernetes .yaml 配置文件:

apiVersion: batch/v1
kind: Job
metadata:
  name: stdout-test
spec:
  template:
    spec:
      priorityClassName: research-high
      containers:
        - name: container-stdout-test
          image: <here comes my secret image repo>
          imagePullPolicy: "IfNotPresent"
          resources:
            limits:
              nvidia.com/gpu: "1"
              cpu: "1"
              memory: "8Gi"
            requests:
              nvidia.com/gpu: "1"
              cpu: "1"
              memory: "4Gi"
          command: ["python3", "/workspace/main.py"]
          volumeMounts:
            - mountPath: /workspace 
              name: localdir 
      imagePullSecrets:
        - name: lsx-registry
      restartPolicy: "Never"
      volumes:
        - name: localdir
          cephfs:
            monitors:
              - <here come my secret monitors>
            user: <namespace>
            path: "/home/stud/nothelfer/stdout-test" 
            secretRef: 
              name: <my secret>
Run Code Online (Sandbox Code Playgroud)

我的简单Python程序( …

python logging kubernetes

2
推荐指数
1
解决办法
7739
查看次数