小编Bik*_*ram的帖子

无论如何要在带有 AMD GPU 的 Mac 中使用 Keras?

我有一台配备 AMD 处理器的 MacBook Pro,我想在这个 GPU 中运行 Keras(Tensorflow 后端)。我开始知道 Keras 只适用于 NVIDIA GPU。解决方法是什么(如果可能)?

pyopencl amd-gpu keras tensorflow2.0 plaidml

12
推荐指数
1
解决办法
7490
查看次数

如何在 Android Studio 中嵌入 android 模拟器?

我知道在 Android Studio 4.1+ 中已经引入了一个嵌入式模拟器。我看不到启用它的选项。

android-emulator android-studio embedded-emulator

8
推荐指数
1
解决办法
2301
查看次数

MaterialDatePicker 错误:要在您的应用主题中设置 materialCalendarFullscreenTheme 属性

我做了什么:

  1. 添加 implementation 'com.google.android.material:material:1.1.0'在依赖项中
  2. 设置Theme.MaterialComponents.Light.Bridge为应用主题的父级
     <style name="AppTheme" parent="Theme.MaterialComponents.Light.Bridge">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>
Run Code Online (Sandbox Code Playgroud)
  1. 试图在片段中显示日期选择器。
MaterialDatePicker.Builder<Pair<Long, Long>> builder = MaterialDatePicker.Builder.dateRangePicker();

        Calendar now = Calendar.getInstance();
        now.set(Calendar.YEAR, 2020);
        now.set(Calendar.MONTH, 1);
        now.set(Calendar.DAY_OF_MONTH, 10);

        long first = now.getTimeInMillis();

        now.set(Calendar.YEAR, 2020);
        now.set(Calendar.MONTH, 5);
        now.set(Calendar.DAY_OF_MONTH, 20);

        long last = now.getTimeInMillis();

        builder.setSelection(new Pair<>(first, last));

        MaterialDatePicker<Pair<Long, Long>> picker = builder.build();

        picker.show(fragmentActivity.getSupportFragmentManager(), "RangePicker");
Run Code Online (Sandbox Code Playgroud)

当我运行代码时,出现此错误

java.lang.IllegalArgumentException: com.google.android.material.datepicker.MaterialDatePicker
requires a value for the com.example:attr/materialCalendarFullscreenTheme attribute to be set
in your app …
Run Code Online (Sandbox Code Playgroud)

android datepicker material-components-android

7
推荐指数
1
解决办法
4209
查看次数

RuntimeError:MacOS 12.3+ 支持 MPS 后端。可以使用“sw_vers”查询当前操作系统版本

由于 Pytorch GPU 对苹果芯片的支持刚刚发布,我尝试使用以下链接中的步骤安装 PyTorch。截至目前,只有夜间版本可用,所以我安装了它。但是,当我运行以下代码时,出现错误。

我关注的链接:

  1. https://pytorch.org/blog/introducing-accelerated-pytorch-training-on-mac/
  2. https://pytorch.org/get-started/locally/

代码:

from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.optim.lr_scheduler import StepLR


class Net(nn.Module):
    def __init__(self):
        super(Net, self).__init__()
        self.conv1 = nn.Conv2d(1, 32, 3, 1)
        self.conv2 = nn.Conv2d(32, 64, 3, 1)
        self.dropout1 = nn.Dropout(0.25)
        self.dropout2 = nn.Dropout(0.5)
        self.fc1 = nn.Linear(9216, 128)
        self.fc2 = nn.Linear(128, 10)

    def forward(self, x):
        x = self.conv1(x)
        x = F.relu(x)
        x …
Run Code Online (Sandbox Code Playgroud)

python pytorch apple-silicon

7
推荐指数
1
解决办法
4403
查看次数

在 Android Studio 3.5 中找不到任何插件市场

当我尝试在 Android Studio 3.5 中搜索插件时,无论我搜索什么插件,它都会加载然后给出“无结果”。它在市场上没有显示任何东西。

android-studio-3.5

5
推荐指数
1
解决办法
3785
查看次数

在依赖项实现'com.google.android.libraries.places:places:1.0.0'中添加此项时,无法解析GlideAnimation

我在build.gradle中有这个

dependencies {
   ...
   ...
   implementation 'com.github.bumptech.glide:glide:3.8.0'

   //getting conflict after adding this library
   implementation 'com.google.android.libraries.places:places:1.0.0'
}
Run Code Online (Sandbox Code Playgroud)

我不知道为什么Cannot resolve com.bumptech.glide.request.animation.GlideAnimation 从Google添加位置库后出现此错误。当我删除此没有问题。

android google-places android-glide

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

为什么我在 tensorflow.js posenet 的响应中让 x 和 y 的位置都为 0?

初始化posenet

const net = await posenet.load();

const pose = await net.estimateSinglePose(videoElement, {
  flipHorizontal: false
});
Run Code Online (Sandbox Code Playgroud)

输出

part: "leftEye"
position: {x: 0, y: 0}
score: 0.9931495785713196
Run Code Online (Sandbox Code Playgroud)

我的问题是,即使分数很高,我的每个身体部位也总是得到位置 0,0。

tensorflow.js

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

无论如何,要在配备 Apple Silicon(M1、M1 Pro、M1 Max)GPU 的 Mac 中使用 Tensorflow 吗?

我有一台配备 M1 Max 处理器的 MacBook Pro,我想在该 GPU 上运行 Tensorflow。我已按照https://developer.apple.com/metal/tensorflow-plugin中的步骤进行操作,但我不知道为什么它在我的 GPU 上运行速度较慢。我使用谷歌官方页面的MNIST 教程进行了测试)。

我尝试过的代码
import tensorflow as tf
import tensorflow_datasets as tfds

DISABLE_GPU = False

if DISABLE_GPU:
    try:
        # Disable all GPUS
        tf.config.set_visible_devices([], 'GPU')
        visible_devices = tf.config.get_visible_devices()
        for device in visible_devices:
            assert device.device_type != 'GPU'
    except:
        # Invalid device or cannot modify virtual devices once initialized.
        pass

print(tf.__version__)

(ds_train, ds_test), ds_info = tfds.load('mnist', split=['train', 'test'], shuffle_files=True, as_supervised=True,
                                         with_info=True)


def normalize_img(image, label):
    return tf.cast(image, tf.float32) / 255., label …
Run Code Online (Sandbox Code Playgroud)

tensorflow apple-silicon

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