tensorflow

tensorflow

Member Since 5 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
99
repos
Aug
5
8 hours ago
Activity icon
issue

ahyunsoo2 issue tensorflow/tensorflow

ahyunsoo2
ahyunsoo2

In ResNet50, It is unequal to actual structure of library in the keras.applications.Resnet50

As you know, in the CNN, only layers of Convolution, BatchNormalization and Dense have weights. And Usually, they are constructed by this way. Input - Conv - BN - ReLU - Conv - BN - ReLU ... - Dense. But, As you can see, below the structure remain unusual.

image

conv2_block1_0_conv/kernel:0
conv2_block1_0_conv/bias:0
conv2_block1_3_conv/kernel:0
conv2_block1_3_conv/bias:0
conv2_block1_1_bn/gamma:0
conv2_block1_1_bn/beta:0
conv2_block1_1_bn/moving_mean:0
conv2_block1_1_bn/moving_variance:0
conv2_block1_3_bn/gamma:0
conv2_block1_3_bn/beta:0
conv2_block1_3_bn/moving_mean:0
conv2_block1_3_bn/moving_variance:0

You can find this result by:

model = tf.keras.application.ResNet50()
#The unusual phenomenon begins with index 18.
model.weights[18]

I recommend that you use debugging mode in your IDE. Then you'll find it easier.

In the below lines, the ResNet50 has stack_fn function for creating layers

def ResNet50():
.
.
  def stack_fn(x):
    x = stack1(x, 64, 3, stride1=1, name='conv2')
    x = stack1(x, 128, 4, name='conv3')
    x = stack1(x, 256, 6, name='conv4')
    return stack1(x, 512, 3, name='conv5')
.
.

In the below codes, the stack1 is for simplifying repeated residential blocks.

def stack1(x, filters, blocks, stride1=2, name=None):


  x = block1(x, filters, stride=stride1, name=name + '_block1')
  for i in range(2, blocks + 1):
    x = block1(x, filters, conv_shortcut=False, name=name + '_block' + str(i))
  return x

In the below structure, the block1 is Residential layers in ResNet50.

def block1(x, filters, kernel_size=3, stride=1, conv_shortcut=True, name=None):

  bn_axis = 3 if backend.image_data_format() == 'channels_last' else 1

  if conv_shortcut:
    shortcut = layers.Conv2D(
        4 * filters, 1, strides=stride, name=name + '_0_conv')(x)
    shortcut = layers.BatchNormalization(
        axis=bn_axis, epsilon=1.001e-5, name=name + '_0_bn')(shortcut) 
  else:
    shortcut = x

  x = layers.Conv2D(filters, 1, strides=stride, name=name + '_1_conv')(x)
  x = layers.BatchNormalization(
      axis=bn_axis, epsilon=1.001e-5, name=name + '_1_bn')(x)
  x = layers.Activation('relu', name=name + '_1_relu')(x)

  x = layers.Conv2D(
      filters, kernel_size, padding='SAME', name=name + '_2_conv')(x)
  x = layers.BatchNormalization(
      axis=bn_axis, epsilon=1.001e-5, name=name + '_2_bn')(x)
  x = layers.Activation('relu', name=name + '_2_relu')(x)

  x = layers.Conv2D(4 * filters, 1, name=name + '_3_conv')(x)
  x = layers.BatchNormalization(
      axis=bn_axis, epsilon=1.001e-5, name=name + '_3_bn')(x)

  x = layers.Add(name=name + '_add')([shortcut, x]) 
  x = layers.Activation('relu', name=name + '_out')(x)
  return x

My problem is why are the model instance different from the actual structures?

Activity icon
issue

jvishnuvardhan issue comment tensorflow/tensorflow

jvishnuvardhan
jvishnuvardhan

As (x*w+x1*w1+...xn*wn+b) checks if the obtained value is the difference between (x) and (y).

It would be interesting that at the end of the model.predict function the value obtained the difference between the X_test and the y_test, thus being necessary to multiply the test matrix (X_test) and the prediction matrix (y_preds) to obtain the final value (y_train), instead of needing to multiply the matrix I'm trying to predict (y_train) and the prediction matrix (y_preds) to get the matrix I'm trying to predict (y_train). This would be useful in cases of future price forecasts of some stock on the stock exchange, because in a real use case, we would have the opening price of the day for example, and we would like to predict the closing price of that same day, using for this the opening price we have at hand.

System information

  • TensorFlow version (you are using): 2.4.1

  • Are you willing to contribute it (Yes/No): Yes.

Describe the feature and the current behavior/state. By default as this happens at the moment we depend on the closing price itself (y_train) to be multiplied by the forecast matrix (y_preds) to get the closing price itself (y_train), this doesn't make much sense in case of future forecasts, of which we do not yet have the future price in hand.

Will this change the current api? How? No.

Who will benefit with this feature? Developers.

jvishnuvardhan
jvishnuvardhan

@neiev What kind of model (TF/Keras) and what kind of layers (Dense/RNN) you are planning to use? Can you show us what is missing with the current implementation? Please provide a simple standalone code to demonstrate the feature.

As you mentioned that you are willing to contribute, you could raise a PR to update any code. Once you open a PR, you can connect this issue to the PR. Thanks!

started
started time in 1 hour ago
push

copybara-service[bot] push tensorflow/tensorflow

copybara-service[bot]
copybara-service[bot]

Add CopyCleanup pass to Kernel Generator.

This pass will be needed once the canonicalization which wrongly casts affine maps away is fixed. Currently, BufferCast(TensorLoad) is canonicalized to Cast even if the TensorLoad operand has a affine map and the BufferCast doesn't. The fix will be to copy the data. This pass will remove the copy and use the source of the copy in the linalg::GenericOp.

PiperOrigin-RevId: 388868812 Change-Id: I55ce46d4b279a227d83752f56a4bb07680c6845d

commit sha: f5eb7d806f496d050bf5a419e2eb1c655886aef0

push time in 1 hour ago
Activity icon
fork

soongxueyong forked tensorflow/lucid

⚡ A collection of infrastructure and tools for research in neural network interpretability.
soongxueyong Apache License 2.0 Updated
fork time in 1 hour ago
Activity icon
issue

puneeshkhanna issue comment tensorflow/tensorflow

puneeshkhanna
puneeshkhanna

FIx random gamma and space to depth tests.

Fix random gamma tests to use deprecated v1 graph mode so that test is executed in both CPU and accelerator because in eager mode, same device will be be only selected irrespective of use_gpu flag. Space to depth testBatchSize0 verification fixed with common code.

Signed-off-by: puneeshkhanna puneesh.khanna83@gmail.com

puneeshkhanna
puneeshkhanna

Any updates on review ? Can this be merged ?

Activity icon
issue

multiverse-tf issue comment tensorflow/tensorflow

multiverse-tf
multiverse-tf

TfLite python delegate support for RB5 robotics platform

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information Robotics RB5 Platform Linux qrb5165-rb5 4.19.125 aarch64 GNU/Linux CPU: Qualcomm QRB5165 RAM: 8GB

  • TensorFlow version (you are using):
  • Python 3.6.9
  • python3-tflite-runtime (2.5.0.post1)
  • hexagon_nn_skel_v1.20.0.1
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state. Currently it works on cpu cores, I would like to delegate it to libhexagon_nn_skel.so. When I run: tflite.load_delegate('libhexagon_nn_skel.so') It returns: OSError: libhexagon_nn_skel.so: wrong ELF class: ELFCLASS32 Same with v65 and v66 Will this change the current api? How? No Who will benefit with this feature? Everyone using RB5 platform with python, and likely oyher sililar Qualcomm products Any Other info.

multiverse-tf
multiverse-tf

Please make sure that this is a feature request. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:feature_template

System information Robotics RB5 Platform Linux qrb5165-rb5 4.19.125 aarch64 GNU/Linux CPU: Qualcomm QRB5165 RAM: 8GB

  • TensorFlow version (you are using):
  • Python 3.6.9
  • python3-tflite-runtime (2.5.0.post1)
  • hexagon_nn_skel_v1.20.0.1
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state. Currently it works on cpu cores, I would like to delegate it to libhexagon_nn_skel.so. When I run: tflite.load_delegate('libhexagon_nn_skel.so')

At first sight, judging from the delegate file name, I don't think you are loading the correct one. Here's an example of using this API: src code and build rule to compile the delegate .so @terryheo could provide more info about using delegate APIs in Python.

As for the TfLite hexagon delegate, have you built the TfLite Hexagon delegate .so file? @karimnosseir could provide more info about this delegate.

It returns: OSError: libhexagon_nn_skel.so: wrong ELF class: ELFCLASS32 Same with v65 and v66 Will this change the current api? How? No Who will benefit with this feature? Everyone using RB5 platform with python, and likely oyher sililar Qualcomm products Any Other info.

pull request

cad-audio pull request tensorflow/tflite-micro

cad-audio
cad-audio

REF_CODE_REFACTOR: mean and reduce_max

refactroing the reference code for mean and reduce_max.

BUG=refactoring existing code.

Activity icon
fork

leksikov forked tensorflow/gan

⚡ Tooling for GANs in TensorFlow
leksikov Apache License 2.0 Updated
fork time in 1 hour ago
push

tensorflow-copybara push tensorflow/serving

tensorflow-copybara
tensorflow-copybara

Updating TensorFlow to latest passing continuous build. Build status: https://source.cloud.google.com/results/invocations/8dafadc5-29ad-4b0c-8748-083787bf23d3

PiperOrigin-RevId: 388868732

commit sha: 53651b7fd196bbd749b5885fad0d140f289f4bef

push time in 1 hour ago
push

github-actions[bot] push tensorflow/docs-l10n

github-actions[bot]
github-actions[bot]

Source snapshot: Thu Aug 5 07:00:39 UTC 2021

Projects and last commit:

commit sha: 42cc2a7260fc44dacda15132823b9a595a84eb2e

push time in 1 hour ago
started
started time in 1 hour ago
Activity icon
issue

racinmat issue comment tensorflow/tensorflow

racinmat
racinmat

Keras load weights fails to load model from directory containing [[

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): CentOS Linux release 7.6.1810 (Core)
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow installed from (source or binary): binary, using conda
  • TensorFlow version (use command below): unknown 1.14.0, with intel MKL
  • Python version: 3.7.4
  • CUDA/cuDNN version: no gpu
  • GPU model and memory: no gpu

Describe the current behavior When model checkpoint is stored in a directory containing [[ in its name, the model fails to load, looks like the model files are missing, throwing NotFoundError

model.load_weights(osp.join(model_dir, 'model')) throws exception when for example, the model_dir='/home/projects/my_ml/data/sims/bs=2048_dataset=[[2019_9_13],[2019_9_12,2019_9_11,2019_9_10,2019_9_9]]'

Describe the expected behavior

model.load_weights(osp.join(model_dir, 'model')) should load the data without problems

Code to reproduce the issue Here is google colab code with mnist example.

Other info / logs The error is NotFoundError: Unsuccessful TensorSliceReader constructor: Failed to find any matching files for bs=2048_dataset=[[2019_9_13],[2019_9_12,2019_9_11,2019_9_10,2019_9_9]]/model

racinmat
racinmat

So I can save the model without escaping, but I need to escape it for loading? In the documentation I can not find any mention of regular expressions, so it's unclear why it does help. So this should be mentioned in the docs if this is the proper way to escape model names, right? I understand this is workaround, not fix of the issue, right?

Activity icon
issue

sushreebarsa issue comment tensorflow/tensorflow

sushreebarsa
sushreebarsa

How can I use multi_gpu in tf.keras?

How can I use multi_gpu in tf.keras? WARNING:tensorflow:From train_conv.py:214: multi_gpu_model (from tensorflow.python.keras.utils.multi_gpu_utils) is deprecated and will be removed after 2020-04-01.

started
started time in 1 hour ago
Activity icon
issue

Srkshaikh5 issue tensorflow/tensorflow

Srkshaikh5
Srkshaikh5

Training weak learners in using video or image dataset on TensorFlow

Hi I have a problem statement where I have to train an action recognizer using videos. but due to non availability of good dataset there is a slight misclassification. Is there any setting or function where I can train the misclassified or weak learners by assigning them more weights. Its sounds similar like Xgboost but I want something which can work on Deeplearning frame works and on Image and Video data set

Thanks.

started
started time in 1 hour ago
Activity icon
fork

vikramdattu forked tensorflow/tflite-micro

⚡ TensorFlow Lite for Microcontrollers
vikramdattu Apache License 2.0 Updated
fork time in 1 hour ago
started
started time in 1 hour ago
started
started time in 1 hour ago
push

copybara-service[bot] push tensorflow/tensorflow

copybara-service[bot]
copybara-service[bot]

Move Assert op from fallback preferred to Mlir preferred

Assert op may contain operands with string types which is not supported by the fallback pass.

PiperOrigin-RevId: 388865569 Change-Id: I0c3754354d0f346dfb15a60f87ffd3fe41ea8558

commit sha: 8443ce3a0afda81683bfb43d630a7344ef6717f7

push time in 1 hour ago
started
started time in 1 hour ago
Activity icon
issue

siwang2011 issue comment tensorflow/profiler

siwang2011
siwang2011

Idle Time

Hi everyone, I started using the Tensorflow profiler, which i found very useful, with the tutorial (https://github.com/tensorflow/tensorboard/blob/master/docs/tensorboard_profiling_keras.ipynb) and with a custom model. In both cases, the idle time in Tensorflow stats is about 90%: is this normal? Why the option "Include idle time" is not the default one?

siwang2011
siwang2011

@ckluk-github hello, i use cpu train the model, the idle time is 97.5% is it normal? thanks

push

tf-models-copybara-bot push tensorflow/models

tf-models-copybara-bot
tf-models-copybara-bot

Remove double licenses

PiperOrigin-RevId: 388865163

commit sha: 027813d334645d6076a72b41b7b87ec30334cbb1

push time in 2 hours ago
push

tf-models-copybara-bot push tensorflow/models

tf-models-copybara-bot
tf-models-copybara-bot

Remove double licenses

PiperOrigin-RevId: 388865163

commit sha: 370f70b523fb0617b1d6f60b7e86e69c4dba1506

push time in 2 hours ago
Activity icon
issue

xunkai55 issue comment tensorflow/tflite-support

xunkai55
xunkai55

Adding dependencies for MlImageAdapter in Android app

I am not able to use MlImageAdapter to convert an ML Image to TensorImage. error: Cannot resolve symbol 'MlImageAdapter' .

The dependencies are in the BUILD file. I am not sure how I can add this library in gradle file (android Java).

xunkai55
xunkai55

Simply adding the following dependency doesn't work :

implementation "org.tensorflow:tensorflow-lite-task-vision:0.0.0-nightly-SNAPSHOT"

Is there additional step that I am missing here?

It's likely that the dependency is not refreshed. Could you please try clean the project, and use ./gradlew --refresh-dependencies or equivalent commands to refresh the dependency?

And if that doesn't work, probably it's caching the 0.2.0 which shadows 0.0.0-nightly. You can try 0.0.0-nightly-SNAPSHOT!! to make it strict.

Is there any plan to add this MLImageAdapter into the stable version any time soon? I think it might be a good idea if i wait and then use this, as my app is in production.

Yes, we plan to include this feature in the next minor version 0.3.0. It's going to happen in this quarter.

pull request

deqiangc pull request tensorflow/tflite-micro

deqiangc
deqiangc

Add a new test case for conv operator (#329)

This new test case is based on issue #329 to increase coverage on optimized kernel's data precision for conv operator. In this test, input, output and filter are all 8 bits and filter tensor is of dimension 8x3x3x3 with different scales per output channel.

TESTED= local test with x86 and HiFi4.

push

tensorflow-copybara push tensorflow/serving

tensorflow-copybara
tensorflow-copybara

Remove dependency on TF error code string

Unblock tensorflow::Status to match absl::Status by sharing the same string representations

PiperOrigin-RevId: 388865011

commit sha: 40f62812aa21e60a3a4f733a76453ac03fc50a56

push time in 2 hours ago
push

copybara-service[bot] push tensorflow/tensorflow

copybara-service[bot]
copybara-service[bot]

Allow _EagerConst op in fallback legalization in tf2xla preferred mode

Also, remove C++ pattern in favor of TableGen pattern for the op.

PiperOrigin-RevId: 388864240 Change-Id: I4c1e8ce9cc781260cadb1102580c200adf7f8ab4

commit sha: 406f84dccfcc53ec90a888f7b69f8b2e96573652

push time in 2 hours ago