tensorflow

How do I know the maximum number of threads per block in python code with either numba or tensorflow installed?

拥有回忆 提交于 2020-12-13 03:15:50
问题 Is there any code in python with either numba or tensorflow installed? For example, if I would like to know the GPU memory info, I can simply use: from numba import cuda gpus = cuda.gpus.lst for gpu in gpus: with gpu: meminfo = cuda.current_context().get_memory_info() print("%s, free: %s bytes, total, %s bytes" % (gpu, meminfo[0], meminfo[1])) in numba. But I can not find any code that gives me the maximum threads per block info. I would like the code to detect the maximum number of threads

从2020昇腾计算产业峰会,看产业生态如何加速AI普惠

谁说我不能喝 提交于 2020-12-12 18:44:35
文 | 曾响铃 来源 | 科技向令说(xiangling0815) 最近,以“昇腾万里,让智能无所不及”为主题的首届昇腾计算产业峰会在上海举办,业内专家、行业先锋、生态伙伴约500多人见证两年后昇腾AI计算产业的全面落地进程。 这个峰会,距离2018年华为Ascend(昇腾)系列产品面世,整整两年时间。 两年间,华为持续投入AI战略,推动昇腾计算产业生态快速发展。 随着此次峰会上《昇腾计算产业发展白皮书》、《昇腾万里伙伴计划》的发布,昇腾计算产业的全面繁荣已经在行业共识基础上按下了启动键。而在业内引发广泛关注的这次峰会,也在AI加速落地的时代勾勒出昇腾通过产业生态的强化推动“AI普惠”的图景——这正是华为两年前发布AI战略和全栈全场景AI解决方案时的重要目标。 市场数据显示,虽然AI在某些特定领域特定场景下准确率已经超过人类,但其全行业渗透率仅有4%,在中国市场,只有10%的B2C应用涉及AI。这些数字,距离AI走向普罗大众,让每个人、每个家庭、每个组织都能享受到人工智能的价值,还有很大的距离。 这个距离,恰恰是昇腾计算产业的价值空间。 01 全栈技术体系,让昇腾计算产业生态拥有全面且灵活的技术支撑 这次昇腾峰会主要动作都聚焦在生态构建上,在谈这些生态动作之前,有必要对昇腾当下已有的技术底子做一个全面剖析。 总体来看,在昇腾生态的主要推动者华为营造下

Unknown number of steps - Training convolution neural network at Google Colab Pro

偶尔善良 提交于 2020-12-12 17:47:34
问题 I am trying to run (training) my CNN at Google Colab Pro , when I run my code, all is allright, but It does not know the number of steps, so an infinite loop is created. Mounted at /content/drive 2.2.0-rc3 Found 10018 images belonging to 2 classes. Found 1336 images belonging to 2 classes. WARNING:tensorflow:`period` argument is deprecated. Please use `save_freq` to specify the frequency in number of batches seen. Epoch 1/300 8/Unknown - 364s 45s/step - loss: 54.9278 - accuracy: 0.5410 I am

4 个场景揭秘,如何低成本让容器化应用 Serverless 化?

萝らか妹 提交于 2020-12-12 15:13:27
作者 | changshuai 来源 | Serverless 公众号 FaaS 的门槛 Serverless 形态的云服务帮助开发者承担了大量复杂的扩缩容、运维、容量规划、云产品打通集成等责任,使得开发者可以专注业务逻辑、提高交付速度 (Time-to-market) ,持续优化成本。Function-as-a-Service (FaaS) 作为云上最早也是应用最广泛的 Serverless 计算形态,在几年的时间内吸引了大批开发者,逐渐建立了 Serverless 优先的选型逻辑。然而从传统应用迁移到 FaaS 在开发者体验上还面临诸多挑战: 环境不统一 :各厂商定义的交付物格式,运行环境兼容性、丰富度都不尽相同,需要开发者适配,甚至重新编译; 学习成本 :打包依赖库、构建成压缩代码包和熟悉的开发部署方式不同; 服务限制 :如代码包限制在百 MB 级别,迫使交付物代码依赖分离,加大管理和发布难度; 交付物缺乏版本管理 :格式不标准,最佳实践不统一,需要开发者自行负责; 生态不成熟 :缺少流行开源工具(如 CI/CD 流水线)的支持和集成。 另一方面,容器在可移植性和交付敏捷性上实现了颠覆式创新。围绕容器的生态沉淀非常丰富且成熟,被广泛接受使用,应用容器化正在快速成为开发和部署的事实标准。然而容器本身并没有减轻运维、扩缩容、闲置成本、和云服务集成等难题。 函数计算支持容器镜像

How to run Tensorflow GPU in Pycharm?

拜拜、爱过 提交于 2020-12-12 14:14:42
问题 I want to run Tensorflow GPU in Pycharm on Linux Mint. I tried some guides like these https://medium.com/@p.venkata.kishore/install-anaconda-tenserflow-gpu-keras-and-pycharm-on-windows-10-6bfb39630e4e https://medium.com/@kekayan/step-by-step-guide-to-install-tensorflow-gpu-on-ubuntu-18-04-lts-6feceb0df5c0 I run this code import tensorflow as tf sess = tf.Session(config=tf.ConfigProto(log_device_placement=True)) I have got this error Traceback (most recent call last): File "/home/alex

Show examples in tensorflow datasets not working

萝らか妹 提交于 2020-12-12 12:11:43
问题 I want to load the tensorflow flowers dataset and visualize it using tfds.show_examples. import tensorflow as tf import numpy as np import matplotlib.pyplot as plt import tensorflow_hub as hub import tensorflow_datasets as tfds from tensorflow.keras import layers import logging logger = tf.get_logger() logger.setLevel(logging.ERROR) (train_examples, validation_examples), info = tfds.load( 'tf_flowers', with_info=True, as_supervised=True, split=['train[:70%]', 'train[70%:]'], ) fig = tfds.show

TensorFlow Federated: How can I write an Input Spec for a model with more than one input

泄露秘密 提交于 2020-12-12 11:05:00
问题 I'm trying to make an image captioning model using the federated learning library provided by tensorflow, but I'm stuck at this error Input 0 of layer dense is incompatible with the layer: : expected min_ndim=2, found ndim=1. this is my input_spec: input_spec=collections.OrderedDict(x=(tf.TensorSpec(shape=(2048,), dtype=tf.float32), tf.TensorSpec(shape=(34,), dtype=tf.int32)), y=tf.TensorSpec(shape=(None), dtype=tf.int32)) The model takes image features as the first input and a list of

TensorFlow Federated: How can I write an Input Spec for a model with more than one input

廉价感情. 提交于 2020-12-12 11:04:28
问题 I'm trying to make an image captioning model using the federated learning library provided by tensorflow, but I'm stuck at this error Input 0 of layer dense is incompatible with the layer: : expected min_ndim=2, found ndim=1. this is my input_spec: input_spec=collections.OrderedDict(x=(tf.TensorSpec(shape=(2048,), dtype=tf.float32), tf.TensorSpec(shape=(34,), dtype=tf.int32)), y=tf.TensorSpec(shape=(None), dtype=tf.int32)) The model takes image features as the first input and a list of

Unknown regularizer: L2 in tensorflowjs

拟墨画扇 提交于 2020-12-12 10:54:34
问题 I have trained a model in python using model reg = 0.000001 model = Sequential() model.add(Dense(24, activation='tanh', name='input_dense', input_shape=input_shape)) model.add(GRU(24, activation='tanh', recurrent_activation='sigmoid', return_sequences=True, kernel_regularizer=regularizers.l2(reg), recurrent_regularizer=regularizers.l2(reg), reset_after=False)) model.add(Flatten()) model.add(Dense(2, activation='softmax')) But when I converted this model using "tensorflowjs_converter --input

Keras CNN for non-image matrix

倾然丶 夕夏残阳落幕 提交于 2020-12-12 10:53:23
问题 I have recently started learning about Deep Learning and Reinforcement Learning, and I am trying to figure out how to code a Convolutional Neural Network using Keras for a matrix of 0s and 1s with 10 rows and 3 columns. The input matrix would look like this for example [ [1, 0, 0], [0, 1, 0], [0, 0, 0], ... ] The output should be another matrix of 0s and 1s, different from the aforementioned input matrix and with a different number of rows and columns. The location of 0s and 1s in the output