我在安装了Xcode 7.2和JDK 8的Mac OS X 10.11.12上安装tensorflow.
我按照这里的说明进行操作 - http://bazel.io/docs/install.html
$ chmod +x install-_version-os.sh_
$ ./install-version-os.sh --user
Run Code Online (Sandbox Code Playgroud)
并已下载该文件 bazel-0.1.2-installer-darwin-x86_64.sh
在给定下载文件的文件名的情况下,如何键入上述说明?
谢谢.
乔治
我听很多人谈论一些原因,但他们从未真正回答是否应该修复。我检查了数据集是否存在泄漏,并从 TFRecords 数据集中随机抽取 20% 作为验证集。我开始怀疑我的模型有太多正则化层。我是否应该减少正则化以使验证线位于训练线之上?或者这真的很重要吗?
neural-network tensorflow keras-layer dropout overfitting-underfitting
我正在尝试在 Anaconda 环境中使用 TensorFlow 1 创建自己的对象检测模型。我想使用 TensorFlow 1.15,并且遵循了本教程 https://github.com/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi
因为我是新手,所以当我到达设置 TensorFlow 的步骤时,我遵循了有关如何设置 TensorFlow 的教程,我使用了命令 pip install 。 使用研究目录中的 setup.py 安装 TensorFlow
安装后,我使用以下命令测试 TensorFlow 设置以验证其是否有效:
python 构建器\model_builder_tf1_test.py
但是,我面临以下错误:
**(tensorflow1) C:\tensorflow1\models\research\object_detection>python builders\model_builder_tf1_test.py
2021-11-15 15:00:30.638411: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2021-11-15 15:00:30.638523: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "builders\model_builder_tf1_test.py", line 21, in
from object_detection.builders import model_builder
File "C:\tensorflow1\models\research\object_detection\builders\model_builder.py", …Run Code Online (Sandbox Code Playgroud) linux_user@server_machine:~/spatial/tuning_neighbors_7$ python3 *hyper*.py
Traceback (most recent call last):
File "tuner_hyperband.py", line 209, in <module>
load_data_k(
File "tuner_hyperband.py", line 127, in load_data_k
tz = tf.convert_to_tensor(data_z, np.float32)
File "/home/linux_user/.local/lib/python3.8/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
raise e.with_traceback(filtered_tb) from None
File "/home/linux_user/.local/lib/python3.8/site-packages/tensorflow/python/framework/constant_op.py", line 106, in convert_to_eager_tensor
return ops.EagerTensor(value, ctx.device_name, dtype)
tensorflow.python.framework.errors_impl.InternalError: Failed copying input tensor from /job:localhost/replica:0/task:0/device:CPU:0 to /job:localhost/replica:0/task:0/device:GPU:0 in order to run _EagerConst: Dst tensor is not initialized.
linux_user@server_machine:~/spatial/tuning_neighbors_7$
Run Code Online (Sandbox Code Playgroud)
造成这个错误的主要原因是什么?
是因为磁盘空间不足吗?
是因为 RAM 内存低吗?
是因为 GPU 占用了吗?
如何解决这个问题?
我正在通过加载图像
data = keras.preprocessing.image_dataset_from_directory(
'./data',
labels='inferred',
label_mode='binary',
validation_split=0.2,
subset="training",
image_size=(img_height, img_width),
batch_size=sz_batch,
crop_to_aspect_ratio=True
)
Run Code Online (Sandbox Code Playgroud)
我也想在非张量流例程中使用获得的数据。因此,我想将数据提取到 numpy 数组中。我怎样才能实现这个目标?我不能使用tfds
我一直在尝试创建 LSTM VAE 来重建 Tensorflow 上的多元时间序列数据。首先,我尝试调整(更改为功能 API,更改层)此处采用的方法,并得出以下代码:
input_shape = 13
latent_dim = 2
prior = tfd.Independent(tfd.Normal(loc=tf.zeros(latent_dim), scale=1), reinterpreted_batch_ndims=1)
input_enc = Input(shape=[512, input_shape])
lstm1 = LSTM(latent_dim * 16, return_sequences=True)(input_enc)
lstm2 = LSTM(latent_dim * 8, return_sequences=True)(lstm1)
lstm3 = LSTM(latent_dim * 4, return_sequences=True)(lstm2)
lstm4 = LSTM(latent_dim * 2, return_sequences=True)(lstm3)
lstm5 = LSTM(latent_dim, return_sequences=True)(lstm4)
lat = Dense(tfpl.MultivariateNormalTriL.params_size(latent_dim))(lstm5)
reg = tfpl.MultivariateNormalTriL(latent_dim, activity_regularizer= tfpl.KLDivergenceRegularizer(prior, weight=1.0))(lat)
lstm6 = LSTM(latent_dim, return_sequences=True)(reg)
lstm7 = LSTM(latent_dim * 2, return_sequences=True)(lstm6)
lstm8 = LSTM(latent_dim * 4, return_sequences=True)(lstm7)
lstm9 = LSTM(latent_dim …Run Code Online (Sandbox Code Playgroud) model.compile(
optimizer= keras.optimizers.Adam(),
loss= [keras.losses.SparseCategoricalCrossentropy(from_logits= True)
],
metrices= ['accuracy'])
model.fit(ds_train, epochs= 10, verbose=2)
Run Code Online (Sandbox Code Playgroud)
compile()类型错误: ({'metrices'},)中的关键字参数无效。有效的关键字参数包括“cloning”、“experimental_run_tf_function”、“distribute”、“target_tensors”或“sample_weight_mode”。
我有一张图像需要进行 OCR(光学字符识别)来提取所有数据。
首先,我想将彩色图像转换为白色背景上的黑色文本,以提高 OCR 准确性。
我尝试下面的代码
from PIL import Image
img = Image.open("data7.png")
img.convert("1").save("result.jpg")
Run Code Online (Sandbox Code Playgroud)
它给了我下面不清楚的图像
我期望有这个图像
然后,我将使用 pytesseract 来获取数据框
import pytesseract as tess
file = Image.open("data7.png")
text = tess.image_to_data(file,lang="eng",output_type='data.frame')
text
Run Code Online (Sandbox Code Playgroud)
最后,我想要得到的数据框如下
python image-processing image-segmentation tensorflow pytorch
我正在尝试在 Tensorflow 中训练模型并收到错误:
Attribute Error: 'method' object has no attribute '_from_serialized'
这是我复制并看到工作的代码。
看来和我的tensorflow版本和python版本的兼容性有关系。我可以运行其他模型,但当我尝试跟踪自定义指标时似乎会发生此错误。
Tensorflow-GPU 和 python 的最新兼容版本是什么,可以在跟踪自定义指标的同时运行模型?
我检查了 Tensorflow 提供的表格,这些版本应该是兼容的。
我当前的Tensorflow版本是2.10.0 Python版本是3.9.6。
是否还有其他原因可能导致此错误。我创建了多个具有不同版本的环境,但仍然收到此错误。
import os
import pickle
from tensorflow.keras import Model
from tensorflow.keras.layers import Input, Conv2D, ReLU, BatchNormalization, \
Flatten, Dense, Reshape, Conv2DTranspose, Activation, Lambda
from tensorflow.keras import backend as K
from tensorflow.keras.optimizers import Adam
from tensorflow.keras.losses import MeanSquaredError
import numpy as np
import tensorflow as tf
class VAE:
"""
VAE represents a Deep Convolutional variational autoencoder architecture
with mirrored …Run Code Online (Sandbox Code Playgroud) 我正在使用 VScode 在 jupyter 上使用 keras_ocr。通过运行此代码:prediction_groups = pipeline.recognize(images) 我收到此错误消息“如何修复错误消息”在回复完成之前取消了execute_request消息的未来在当前单元格或上一个单元格中执行代码时内核崩溃细胞。请检查单元格中的代码以确定失败的可能原因。点击这里查看更多信息。查看 Jupyter 日志以获取更多详细信息。”有人可以帮我解决这个问题吗
解决内核问题
tensorflow ×10
python ×6
keras ×4
autoencoder ×1
bazel ×1
dropout ×1
gpu ×1
keras-layer ×1
macos ×1
model ×1
pytorch ×1
typeerror ×1