'LookupAlignConvolution2d' no object '_convolution_op' attribute error - python

I have been working with the project tf-lcnn (https://github.com/ildoonet/tf-lcnn). I have built tensorflow from sources (1.4.1) and I am using python3 to run the command python3 train.py. This issue is that when I run said command I get:
AttributeError: 'LookupAlignConvolution2d' object has no attribute '_convolution_op'
I have tried tensorflow versions(1.3 and 1.4) and nothing gets the project to work. The custom_op was linked properly and works. The instructions from the project don't state that you have to follow his instructions first then build tensorflow. He also doesn't express the configuration build that he used.
I have tried some different approaches but I am sure there is something I am missing or doing wrong. Any help would be appreciated. I can post additional information upon request. Thanks in advance!

Related

Example of jqgrid with python

So I've cloned this
https://bitbucket.org/romildo/django-jqgrid-demo.git
as I am looking for a working example of jqgrid with django.
I've been updating the code (as this seems like it was written for a version 2 of django and I'm workng on 4.1)
I'm completely stumped by the lines
from jqgrid import JqGrid
giving me this error
ModuleNotFoundError: No module named 'jqgrid'
I cannot find a reference to jqgrid within pip and I cannot install one (jqgrid is not a python package)
I understand that jqgrid is a javascript component around jquery but how do I get that to work in Python
I have google for django-jqgrid and on youtube. None of the answers provide enough information to get a simple working example up. There seems to be an assumption that everything is installed and I'd like to understand what is required where and how to reference
What am I missing?
Simply you can install this library:
pip install js.jqgrid
And now your above error will solve

Attribute Error: 'RandomNumberGenerator._generator_ctor' in gym.utils.seeding

I´m trying to run a reinforcement learning algorithm for a production line optimization. As an engineering student I am not very familiar with coding so I´m looking for help from you guys.
I get this error when trying to train the agent: AttributeError: Can't get attribute 'RandomNumberGenerator._generator_ctor' on <module 'gym.utils.seeding'
I´m curious because it doesn´t seem to be related to my code but gym (Can be totally wrong though).
Any ideas? If you need further information about the problem please tell me. Idk whats necessary to know.
I use Python 3.9 on VS on Windows 10 if that helps
Thx for any help :)
I was running the agents training. It started the local ray instance for the training but then the forementioned error popped up
According to my experience, you should try to use gym version 0.25.2 or below (just use pip install gym==0.25.2) because some modules might be deprecated such as mentioned in this page.
Or, you can use version 0.25.1, as mentioned here.

How to resolve the error "cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'"

My friends and I are partaking in a hackathon and are stuck on this one tutorial on training an object detection model:
https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html
But after three people have tried to follow the above tutorial to the letter, we are all stuck on the creating TfRecord step:
https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html#create-tensorflow-records
We get the error message:
ImportError: cannot import name 'string_int_label_map_pb2' from 'object_detection.protos'
We are three different people, with three different machines, getting this result, and have spent in total 20+ person-hours googling, retrying, sacrificing things to eldritch gods and nothing gets us passed this hurdle.
Is there a better way of achieving the result, or a fix for the issue? We are inexperienced with Tensorflow and are just wanting to use it to train a model that can be converted to an onnx model that will be consumed by ml.net.
The solution that works for me is as follows:
If you are creating a Virtual environment:
Run the command after you create the environment to change the Google file .protp to .py:
protoc object_detection/protos/*.proto --python_out=.
However, if you are still facing an error, you can simply run the code on a google colab notebook:
Protos Conversion to Python
%%cd /content/drive/MyDrive/TFOD1.x/models/research
!protoc object_detection/protos/*.proto --python_out=.
get the file in protoc folder, then copy it into the >models>research>protoc
And (import step):
Copy the folder to your environment path:
For example:
C:\Users\x04xx18\Anaconda3\envs\tfod1.x\libs\protos
This should fix the error for you!
Thanks to #EdwinCheong for pointing us in the correct direction.
The issue was resolved by basically downloading the Windows 10 SDK and a bunch of c++ -related packages in the Visual Studio Installer before following this linked tutorial:
https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/install.html#tf-models-install related to installing object detection. CUDA seems to be required regardless of what the tutorial says

Trouble setting up 'Bachbot': Python gives no such command-error while installed correctly?

I am trying to set up Bachbot (https://github.com/feynmanliang/bachbot) on my Windows 10 system in Python 3.5.1, Anaconda 4.0.0. Though doing several attempts, I keep failing at getting this to work. I downloaded the source code from github (didn't use Docker) and got to work.
First thing that's good to know is that I changed all print statements and added parantheses. Furthermore I changed every import of cPickle to
import _pickle as cPickle
since I'm using a newer version of Python. By doing this, I cleared all compile errors, but now I'm stuck at the first few steps of getting the program to work. When calling
bachbot chorales prepare_poly
I get an error
Usage: bachbot-script.py [OPTIONS] COMMAND [ARGS]
Error: no such command "chorales"
I figured the chorales script is part of the music21-module, which I installed on my computer using pip.
As far as I know I followed the installation steps more or less correctly (see github Getting Started and Workflow):
run activate script
run pip install --editable .
2.5 (installed the missing module music21)
run bachbot chorales prepare_poly
I suspect it has something to do with the entry point but I can't put a finger on what's wrong. I tried several re-installs but that does not seem to do the trick.
I would be grateful if someone could help me with this. Thanks in advance!
My apologies, I was rushing to get the thesis in on time so the documentation is not the best!
The commands for building the polyphonic dataset and training the model are:
bachbot datasets prepare
bachbot datasets concatenate_corpus scratch/BWV-*.utf
bachbot make_h5
bachbot train
To use the model trained for $ITER iterations to generate samples with a sampling temperature of $TMP:
bachbot sample ~/bachbot/scratch/checkpoints/*/checkpoint_<ITER>.t7 -t <TEMP>
bachbot decode sampled_stream ~/bachbot/scratch/sampled_$TMP.utf
The first and last section of a recent presentation I made summarizes this workflow.
By the way, I would recommend using the Docker image described in the presentation I linked. While the CLI is in Python, the actual LSTM has additional dependencies (e.g. Lua, Torch, CUDA if you plan on using a GPU).

Installing mesos egg for python 2.7

I've installed mesos 0.26 successfully on a vm machine.
The installation has been performed on an ubuntu trusty thar system
by following this manual:
https://open.mesosphere.com/getting-started/install/
So far so good. I wanted to write a tiny python framwork.
For this I need to install the eggs via easy_install:
(I've downloaded the eggs accordingly for the trusty thar ubuntu and the 0.26 mesos):
wget http://downloads.mesosphere.io/master/ubuntu/14.04/mesos-0.26.0-py2.7-linux-x86_64.egg
easy_install mesos-0.26.0-py2.7-linux-x86_64.egg
all went fine, however, if I start python in the shell
and type in
import mesos.interface
I get the message: ImportError: No module named interface
As someone suggested, it may be that there is no longer a binding for python, or that they have renamed the API calls. Well, I looked in the version updates here:
http://mesos.apache.org/documentation/latest/upgrades/
Since the transition from 0.19.x to 0.20.x there hasn't been any changes regarding the mesos.interface part, or at least they are not mentioning it here.
To increase the confusion I also get the following error message when I'm typing in python: import mesos.native
There I receive: ImportError: No module named interface.mesos_pb2. To put it into a nutshell: what is going wrong here, and how can it be fixed? And yes, I've googled various web pages, with terms such as "mesos python bindings", mesos +api +python, etc. And yes, I have also consulted the official mesos webpage. There are nice refences for Java and C++ but not for python, or at least they are very well hidden.
Thanks in advance for any hints.
Solved. For what reasons ever:
export PYTHONPATH=${PYTHONPATH}:/usr/lib/python2.7/site-packages/
is required to set the PYTHONPATH. After that step it works like a charm.

Categories

Resources