小编sth*_*mps的帖子

如何并行处理单个培训文件

我有一个文件train.csv,其中包含图像及其标签的路径.即:

img1.jpg 3
img2.jpg 1
...
Run Code Online (Sandbox Code Playgroud)

阅读阅读数据教程之后,我想出了一些代码来遍历每个图像,调整大小并应用扭曲:

def apply_distortions(resized_image):
    # do a bunch of tf.image distortion...
    return float_image

def processing(filename):
    file_contents = tf.read_file(filename)
    image = tf.image.decode_jpeg(file_contents, channels=3)
    resized_image = tf.image.resize_images(image, 299, 299)
    distorted_image = apply_distortions(resized_image)
    return distorted_image

def parse_csv(filename_queue):
    line_reader = tf.TextLineReader()
    key, line = line_reader.read(filename_queue)
    filename, label = tf.decode_csv(line,     # line_batch or line (depending if you want to batch)
                               record_defaults=[tf.constant([],dtype=tf.string),
                                                tf.constant([],dtype=tf.int32)],
                               field_delim=' ')
    processed_image = processing(filename)
    return processed_image, label
Run Code Online (Sandbox Code Playgroud)

现在的问题是我很困惑如何在文件中并行执行这些操作.文档建议使用tf.train.batch_jointf.train.batch …

tensorflow

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

部署在Kubernetes仪表板中不可见

我已经创建了这样的部署:

kubectl run my-app --image=ecr.us-east-1.amazonaws.com/my-app:v1 -l name=my-app --replicas=1
Run Code Online (Sandbox Code Playgroud)

现在我转到Kubernetes仪表板:

https://172.0.0.1/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
Run Code Online (Sandbox Code Playgroud)

但我没看到my-app这里列出的.

是否可以使用Kubernetes仪表板查看部署?我想使用仪表板来查看部署mem/cpu使用情况,检查日志等

kubernetes

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

如何绘制用虚线连接的点?

我使用 Mapbox GL JS 绘制地图。我想在地图上绘制几个点序列。每个点都应在地图上显示为一个圆圈。一系列点应该用虚线连接。此外,每个点序列都应使用不同的颜色进行着色。

这是我的 geojson 的示例:

const geoJson = {
  type: 'FeatureCollection',
  features: [
    {
      type: 'Feature',
      properties: {
        id: 1,
      },
      geometry: {
        type: 'LineString',
        coordinates: [
          [-77.0366048812866, 38.89873175227713],
          [-77.03364372253417, 38.89876515143842],
          [-77.03364372253417, 38.89549195896866],
          [-77.02982425689697, 38.89549195896866],
          [-77.02400922775269, 38.89387200688839],
          [-77.01519012451172, 38.891416957534204],
          [-77.01521158218382, 38.892068305429156],
          [-77.00813055038452, 38.892051604275686],
          [-77.00832366943358, 38.89143365883688],
          [-77.00818419456482, 38.89082405874451],
          [-77.00815200805664, 38.88989712255097],
        ],
      },
    },
    {
      type: 'Feature',
      properties: {
        id: 2,
      },
      geometry: {
        type: 'LineString',
        coordinates: [
          [-77.027035, 38.913438],
          [-77.015877, 38.917178],
          [-77.009525, 38.917980],
        ],
      },
    },
  ],
}; …
Run Code Online (Sandbox Code Playgroud)

mapbox-gl-js

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

安排 pod 每 X 分钟运行一次

我有一个程序可以执行一些代码,休眠 10 分钟,然后重复。这在无限循环中继续。我想知道是否有办法让 Kubernetes/GKE 处理这个调度。

我看到 GKE 提供了 cron 调度。我可以安排一个 pod 每 10 分钟运行一次。问题是在某些情况下,程序可能需要 10 多分钟才能完成。

理想情况下,我可以让 pod 运行完成,安排它在 10 分钟内运行,重复。这可能吗?

这在 Kubernetes 上可行吗?

kubernetes google-kubernetes-engine

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

如何显示git diff的装订线?

在IntelliJ中,文本编辑区左侧有一个可以显示git差异的装订线.我想在android studio中拥有相同的东西.有没有办法让它出现?

android-studio

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