小编Ton*_*ony的帖子

SourceKitService已终止

我遇到了Xcode的问题,其中弹出了"Source Kit Service Terminated"错误,所有语法高亮和代码完成都在Swift中消失了.我怎样才能解决这个问题?

这是一个示例图像:

在此输入图像描述

xcode ios swift sourcekitservice

241
推荐指数
9
解决办法
4万
查看次数

Tensorflow自定义TFLite java.lang.NullPointerException:无法为解释器分配内存

我使用以下命令从https://github.com/tensorflow/hub/blob/master/examples/image_retraining/retrain.py使用retrain.py创建了一个自定义tensorflow lite模型

python retrain.py --image_dir newImageDirectory --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v2_100_224/feature_vector/1
Run Code Online (Sandbox Code Playgroud)

然后我使用toco将output_graph.pb文件转换为lite文件.使用以下命令

bazel run tensorflow/contrib/lite/toco:toco -- --input_file=/tmp/output_graph.pb --output_file=/tmp/optimized.lite --input_format=TENSORFLOW_GRAPHDEF --output_format=TFLITE --inpute_shape=1,224,224,3 --input_array=input --output_array=final_result --inference_type=FLOAT --input_data_type=FLOAT
Run Code Online (Sandbox Code Playgroud)

然后我拿新的lite文件和labels.txt文件并将它们放在tensorsflow中为诗人2 https://github.com/googlecodelabs/tensorflow-for-poets-2看看我是否可以让它开始分类新的类别.应用程序启动时,我收到以下错误.

Caused by: java.lang.NullPointerException: Can not allocate memory for the interpreter                                                                                            at org.tensorflow.lite.NativeInterpreterWrapper.createInterpreter(Native Method)
                                                                      at org.tensorflow.lite.NativeInterpreterWrapper.<init>(NativeInterpreterWrapper.java:63)
                                                                                        at org.tensorflow.lite.NativeInterpreterWrapper.<init>(NativeInterpreterWrapper.java:51)
                                                                                        at org.tensorflow.lite.Interpreter.<init>(Interpreter.java:90)
                                                                                        at com.example.android.tflitecamerademo.ImageClassifier.<init>(ImageClassifier.java:97)
Run Code Online (Sandbox Code Playgroud)

python android tensorflow

10
推荐指数
1
解决办法
316
查看次数

无法打开'Optional.None'

遇到错误致命错误时:

无法打开Optional.None

追踪这一点并不容易.是什么导致这个错误?

码:

import UIKit

class WelcomeViewController: UIViewController {
    let cornerRad:CGFloat = 10.0
    @IBOutlet var label:UILabel
    @IBOutlet var lvl1:UIButton
    @IBOutlet var lvl2:UIButton
    @IBOutlet var lvl3:UIButton
    init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        lvl1.layer.cornerRadius = cornerRad
        lvl2.layer.cornerRadius = cornerRad
        lvl3.layer.cornerRadius = cornerRad
    }
}
Run Code Online (Sandbox Code Playgroud)

ios swift

8
推荐指数
2
解决办法
5307
查看次数

跟踪多点触控中的触控点

我正在制作一个绘图项目,我想支持多点触控,我已经通过在线文档,建议跟踪触摸点,我做了,但我没有得到理想的行为.我没有得到直线.

以下是我的代码

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    red = 0.0/255.0;
    green = 0.0/255.0;
    blue = 0.0/255.0;
    brush = 10.0;
    opacity = 1.0;

     self.view.multipleTouchEnabled = YES;

     touchPaths = [NSMutableDictionary dictionary];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {


    for (UITouch *touch in touches)
    {
        NSString *key = [NSString stringWithFormat:@"%d", (int) touch];
        lastPoint = [touch locationInView:self.view];

        [touchPaths setObject:[NSValue valueWithCGPoint:lastPoint] forKey:key];
    }

}


- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{

    for (UITouch …
Run Code Online (Sandbox Code Playgroud)

core-graphics multi-touch uikit cgcontext ios

6
推荐指数
1
解决办法
1493
查看次数

.gradle 缓存文件夹中的 transforms-1 文件夹是什么

有没有人碰巧知道或拥有关于 gradle 缓存的 transforms-1 文件夹的文档?例如在 Mac 上,文件夹路径是 ~/.gradle/caches/transforms-1。似乎 Android studio 使用它,但我想知道它还有什么用?

android caching gradle android-gradle-plugin

6
推荐指数
1
解决办法
1295
查看次数