pythonunbuffered=1_Dockerfile返回非零代码:1

我试图在amazonsageaker中使用DockerFile构建一个映像,但是我得到了以下错误。在Traceback (most recent call last):

File "/usr/bin/pip3", line 9, in

from pip import main ImportError: cannot import name 'main' The command '/bin/sh -c pip3 install --upgrade pip setuptools wheel &&

pip3 install mxnet-cu90 --upgrade --pre && pip3 install

keras-mxnet --upgrade --pre' returned a non-zero code: 1

我的DockerFile如下FROM nvidia/cuda:9.0-runtime

RUN apt-get update && \

apt-get -y install build-essential libopencv-dev libopenblas-dev libjemalloc-dev libgfortran3 \

python-dev python3-dev python3-pip wget curl

COPY train_siamese_network.py /opt/program/train RUN chmod +x /opt/program/train

RUN mkdir /root/.keras COPY keras.json /root/.keras/

RUN pip3 install --upgrade pip setuptools wheel && \

pip3 install mxnet-cu90 --upgrade --pre && \

pip3 install keras-mxnet --upgrade --pre

RUN rm -rf /var/lib/apt/lists/* RUN rm -rf /root/.cache

ENV PYTHONDONTWRITEBYTECODE=1 \

PYTHONUNBUFFERED=1 \

LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/local/lib"

ENV PATH="/opt/program:${PATH}"

WORKDIR /opt/program

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
import sys sys.tracebacklimit = 0 import os os.environ['PYTHONUNBUFFERED'] = '1'import arcpy # 获取参数 input_features = arcpy.GetParameterAsText(0) join_field = arcpy.GetParameterAsText(1) target_feature = arcpy.GetParameterAsText(2) target_field = arcpy.GetParameterAsText(3) area_threshold = arcpy.GetParameterAsText(4) # 创建空间连接 join_result = arcpy.SpatialJoin_analysis(input_features, target_feature, "in_memory/spatial_join", "JOIN_ONE_TO_ONE", "KEEP_ALL", "", "INTERSECT") # 使用MakeFeatureLayer创建要素图层,并使用AddFieldDelimiters处理字段名称 join_layer = arcpy.management.MakeFeatureLayer(join_result, "join_layer").getOutput(0) join_field_name = arcpy.AddFieldDelimiters(join_layer, join_field) # 使用SelectLayerByAttribute选择重叠面积大于阈值的要素 arcpy.management.SelectLayerByAttribute(join_layer, "NEW_SELECTION", "Shape_Area > " + str(area_threshold)) # 使用SummaryStatistics工具进行面积求和 summary_table = arcpy.Statistics_analysis(join_layer, "in_memory/summary_table", [["Shape_Area", "SUM"]], join_field_name) # 使用TableToNumPyArray将结果转换为字典 sum_dict = {} with arcpy.da.TableToNumPyArray(summary_table, [join_field, "SUM_Shape_Area"]) as arr: for row in arr: sum_dict[row[0]] = row[1] # 使用UpdateCursor更新目标要素类的目标字段 with arcpy.da.UpdateCursor(target_feature, [target_field, join_field], sql_clause=(None, "ORDER BY OBJECTID")) as cursor: for row in cursor: join_value = row[1] if join_value in sum_dict: area_sum = sum_dict[join_value] row[0] = area_sum cursor.updateRow(row) # 导出结果 output_feature = arcpy.GetParameterAsText(5) arcpy.CopyFeatures_management(target_feature, output_feature) # 删除游标对象和要素图层对象 del cursor, join_layer运行错误SyntaxError: invalid syntax (空间连接.py, line 4) 执行(ccc)失败。请改正代码
05-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值