Categories
Misc

Tensorflow Object Detection API pycocotools Error

Tensorflow Object Detection API pycocotools Error

Hi guys,

need help setting up pycocotools for my training. I have installed through git, pip and even conda. Been stuck on it for the past three days. When i run my main python file, i keep getting this error:

I am using

windows 10 64bits, python 3.7 Anaconda,tensorflow 2.4.1, CUDA 11.0.2 and Cudnn 8.0.2.

python model_main_tf2.py –model_dir=models/ssd_mobilenet_v2_fpnlite –pipeline_config_path=models/ssd_mobilenet_v2_fpnlite/pipeline.config

Any help on this??

https://preview.redd.it/ri0w25ojpkk61.png?width=1441&format=png&auto=webp&s=1cb0b8ddacd815a5d823de92f738dd267c30fd7a

submitted by /u/jason_rims
[visit reddit] [comments]

Categories
Misc

TF Beginner, i made a little TFJS Web App

TF Beginner, i made a little TFJS Web App submitted by /u/DonRedditor
[visit reddit] [comments]
Categories
Misc

Starting with AI

Hi all,

It’s been some time since I’ve been flirting with the idea of joining the AI developers community. I’m a 10 year experienced .Net developer and the main thing I want to use AI for is for video detection, tracking, stats, etc..

After some digging, I’ve found TensorFlow might be exactly what I’m looking for but I wanted to take some advice regarding which training I should do first..

Python? TensorFlow? Maybe start with other theoretical concepts first?

Thanks!

submitted by /u/argenstark
[visit reddit] [comments]

Categories
Misc

Image classification FCN training

I have a dataset of posts on a website (which I have downloaded in file format data/category1 and data/category2) all are png, or jpg format files. All with unique dimensions. Is there a way to train the neural network without resizing the images? I already know I would have to train them in separate batches, but I cannot for the life of me figure out how to get them all into individual batches to be trained. Thank you in advance for your help 😀

submitted by /u/Yo1up
[visit reddit] [comments]

Categories
Misc

Error when returning tf.keras.Model

I want to create a python program for neural style transfer based on this tutorial: https://medium.com/tensorflow/neural-style-transfer-creating-art-with-deep-learning-using-tf-keras-and-eager-execution-7d541ac31398. They used tensorflow 1.* for this but I use tensorflow 2.* (gpu), so I had to change a few things. Both my version and the original version of the program raised a ValueError when I tried to return a vgg19 model. Can someone explain this error or tell me how to fix it?

“`def get_model(): vgg = tf.keras.applications.vgg19.VGG19(include_top = False, weights = ‘imagenet’) vgg.trainable = False style_outputs = [vgg.get_layer(name) for name in style_layers] content_outputs = [vgg.get_layer(name) for name in content_layers] model_outputs = style_outputs + content_outputs return tf.keras.Model(vgg.input, model_outputs)

Traceback (most recent call last): File “NSTV2.py”, line 155, in <module> main() File “NST_V2.py”, line 152, in main best, best_loss = run_style_transfer(args[‘content’], args[‘style’]) File “NST_V2.py”, line 101, in run_style_transfer model = get_model() File “NST_V2.py”, line 48, in get_model return tf.keras.Model(vgg.input, model_outputs) File “C:UsersfreddAppDataLocalProgramsPythonPython38libsite-packagestensorflowpythontrainingtrackingbase.py”, line 517, in _method_wrapper result = method(self, args, *kwargs) File “C:UsersfreddAppDataLocalProgramsPythonPython38libsite-packagestensorflowpythonkerasenginefunctional.py”, line 120, in __init_ self._init_graph_network(inputs, outputs) File “C:UsersfreddAppDataLocalProgramsPythonPython38libsite-packagestensorflowpythontrainingtrackingbase.py”, line 517, in _method_wrapper result = method(self, args, *kwargs) File “C:UsersfreddAppDataLocalProgramsPythonPython38libsite-packagestensorflowpythonkerasenginefunctional.py”, line 157, in _init_graph_network self._validate_graph_inputs_and_outputs() File “C:UsersfreddAppDataLocalProgramsPythonPython38libsite-packagestensorflowpythonkerasenginefunctional.py”, line 727, in _validate_graph_inputs_and_outputs raise ValueError(‘Output tensors of a ‘ + cls_name + ‘ model must be ‘ ValueError: Output tensors of a Functional model must be the output of a TensorFlow Layer (thus holding past layer metadata). Found: <tensorflow.python.keras.layers.convolutional.Conv2D object at 0x000002A05C2F9D60>“`

submitted by /u/Jirne_VR
[visit reddit] [comments]

Categories
Misc

Tensorflow DQN execution time keeps on increasing

Hello. I have a question regarding tensorflow. I was working on a Deep Q Network problem using Tensorflow. The code is as follows:

“`

g = tf.Graph() with g.as_default(): w_1 = tf.Variable(tf.truncated_normal([n_input, n_hidden_1], stddev=0.1)) w_1_p = tf.Variable(tf.truncated_normal([n_input, n_hidden_1], stddev=0.1)) ## There are other parameters too but they are excluded for simplicity

def update_target_q_network(sess): “”” Update target q network once in a while “”” sess.run(w_1_p.assign(sess.run(w_1)))

for i_episode in range(n_episode): …….. #Code removed for simplicity if i_episode%10 == 0: update_target_q_network(centralsess) ……..

“`

Basically after every specific number of n_episodes (10 in this case), the parameter w_1 is copied to w_1_p.

The issue with the code is that the time it takes to run the function update_target_q_network keeps on increasing as the n_episodes increase. So for example it takes 0-1 second for 100th episode however the time increase to 220 seconds for 7500th episode. Can anyone kindly tell how can the running time of the code can be improved? I tried reading the reason (the graph keeps on becoming larger) but I am not sure about that or how or change code to reduce time. Thank you for your help.

submitted by /u/FarzanUllah
[visit reddit] [comments]

Categories
Misc

Pre-Processing Images for Pre-Trained Models in Tensorflow.js

Check out my question on stackoverflow for specifics, but I’m wondering about general strategies for pre-processing inputs into Tensorflow.js….do I need to use a convolutional network? Can I use the model to pre-process input? There’s some commands in python that are missing in js for doing this

submitted by /u/areddy831
[visit reddit] [comments]

Categories
Misc

Unable to print tf.Variable objects

I am trying to print a list of objects, some of which are constants and some and some are variables. When i print the list, only the constant tensors are shown, while Variables are are represented by empty space. They are present in the calculation, and that is going through without a hitch. But somehow in this print issue, they are absent.

submitted by /u/curtlytalks
[visit reddit] [comments]

Categories
Misc

Big Planet, Bigger Data: How UK Research Center Advances Environmental Science with AI

Climate change is a big problem, and big problems require big data to understand. Few research centers take a wider lens to environmental science than the NERC Earth Observation Data Acquisition and Analysis Service (NEODAAS). Since the 1990s, the service, part of the United Kingdom’s Natural Environment Research Council and overseen by the National Centre Read article >

The post Big Planet, Bigger Data: How UK Research Center Advances Environmental Science with AI appeared first on The Official NVIDIA Blog.

Categories
Misc

[_Derived_]RecvAsync is cancelled – LSTM

Hey,

Tensorflow broke in my conda environment and I cant seem to get it working again. I’m having differnt issues with getting tensorflow-gpu==2.3.0 and 2.4.1 working.

GTX 1070 GPU drivers:

-CUDA 11.0.3

-CUDNN 8.0.5.77

installed with $conda install cudatoolkit=11.0 cudnn=8.0 -c=conda-forge

-Python 3.8.8

Tensorflow 2.4.1:

tensorflow 2.3.0 mkl_py38h8557ec7_0 tensorflow-base 2.3.0 eigen_py38h75a453f_0 tensorflow-estimator 2.4.0 pyh9656e83_0 conda-forge tensorflow-gpu 2.3.0 he13fc11_0 

installed with pip install –upgrade tensorflow-gpu==2.4.1

I have set all the environment variables correctly. Checking with print(tf.config.list_physical_devices(‘GPU’)) gives: [PhysicalDevice(name=’/physical_device:GPU:0′, device_type=’GPU’)]

So tensorflow seems to be installed and recognises my gpu. I’ve been working on a LSTM model, when training with $ model.fit() , it runs for 6 epochs and then gives this error

Epoch 1/50 2021-02-27 14:50:38.552734: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:116] None of the MLIR optimization passes are enabled (registered 2) 2021-02-27 14:50:38.882403: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublas64_11.dll 2021-02-27 14:50:39.546250: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cublasLt64_11.dll 2021-02-27 14:50:39.794953: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudnn64_8.dll 37/37 [==============================] - 7s 55ms/step - loss: 7.0684 - accuracy: 0.1270 Epoch 2/50 37/37 [==============================] - 2s 54ms/step - loss: 4.8889 - accuracy: 0.1828 Epoch 3/50 37/37 [==============================] - 2s 54ms/step - loss: 4.7884 - accuracy: 0.1666 Epoch 4/50 37/37 [==============================] - 2s 54ms/step - loss: 4.6866 - accuracy: 0.1480 Epoch 5/50 37/37 [==============================] - 2s 55ms/step - loss: 4.5179 - accuracy: 0.1630 Epoch 6/50 17/37 [============>.................] - ETA: 1s - loss: 4.2505 - accuracy: 0.14842021-02-27 14:50:55.955000: E tensorflow/stream_executor/dnn.cc:616] CUDNN_STATUS_INTERNAL_ERROR in tensorflow/stream_executor/cuda/cuda_dnn.cc(2004): 'cudnnRNNBackwardWeights( cudnn.handle(), rnn_desc.handle(), model_dims.max_seq_length, input_desc.handles(), input_data.opaque(), input_h_desc.handle(), input_h_data.opaque(), output_desc.handles(), output_data.opaque(), workspace.opaque(), workspace.size(), rnn_desc.params_handle(), params_backprop_data->opaque(), reserve_space_data->opaque(), reserve_space_data->size())' 2021-02-27 14:50:55.955194: W tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at cudnn_rnn_ops.cc:1926 : Internal: Failed to call ThenRnnBackward with model config: [rnn_mode, rnn_input_mode, rnn_direction_mode]: 2, 0, 0 , [num_layers, input_size, num_units, dir_count, max_seq_length, batch_size, cell_num_units]: [1, 256, 256, 1, 100, 64, 256] 2021-02-27 14:50:55,957 : MainThread : INFO : Saving model history to model_history.csv 2021-02-27 14:50:55,961 : MainThread : INFO : Saving model to D:projectproject_enginefftest_checkpointsbatch_0synthetic Traceback (most recent call last): File "runTrain.py", line 65, in <module> model.train() ... ... ... File "D:projectproject_enginerunTrain.py", line 201, in train_rnn model.fit(dataset, epochs=store.epochs, callbacks=_callbacks) File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythonkerasenginetraining.py", line 1100, in fit tmp_logs = self.train_function(iterator) File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerdef_function.py", line 828, in __call__ result = self._call(*args, **kwds) File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerdef_function.py", line 855, in _call return self._stateless_fn(*args, **kwds) # pylint: disable=not-callable File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerfunction.py", line 2942, in __call__ return graph_function._call_flat( File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerfunction.py", line 1918, in _call_flat return self._build_call_outputs(self._inference_function.call( File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerfunction.py", line 555, in call outputs = execute.execute( File "C:UsersMeanaconda3envstf_gpulibsite-packagestensorflowpythoneagerexecute.py", line 59, in quick_execute tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name, tensorflow.python.framework.errors_impl.CancelledError: [_Derived_]RecvAsync is cancelled. [[{{node gradient_tape/sequential/embedding/embedding_lookup/Reshape/_20}}]] [Op:__inference_train_function_4800] Function call stack: train_function 

Tensorflow forums with similar issues mention memory or driver issues but this isn’t the case as the model wouldn’t start training at all. Also I know the code is fine because I trained on the same code with no issue in an old environment I was using 2 months ago. It also runs fine in a CPU only tensorflow environment.

Does anyone have any suggestions on how to fix this?

Tensorflow 2.3.0:

Secondly, I cant even try another version of tensorflow gpu in a different environment.

conda install -c anaconda tensorflow-gpu 

Tensorflow GPU succesfully installs but doesn’t run on my GPU for reasons stated here – https://www.reddit.com/r/tensorflow/comments/jtwcth/how_to_enable_tensorflow_code_to_run_on_a_gpu/gp0b3mf/

I’ve now lost 2 days and a lot of will to leave, any help with either issues would be massively appreciated.

submitted by /u/nuusain
[visit reddit] [comments]