Coder Social home page Coder Social logo

Comments (7)

schleptech avatar schleptech commented on June 5, 2024 1

Good deal! Got everything to work for me -
so to summarize - I followed your step of
pip install -U albumentations --no-binary qudida,albumentations

Which installed the newer version of albumentations (colab has an old version) and the script also brought in the appropriate opencv-python-headless.
Note: in google colab (which I am not familiar with particularly; I primarily use AWS EC2 instances via SSH) you must restart the runtime!

Also remember to change cocoeval.py everytime you bring the runtime back up.

Working just as you specified. Thanks!

from keypoint_rcnn_training_pytorch.

alexppppp avatar alexppppp commented on June 5, 2024

You need to install a newer version of albumentations library

from keypoint_rcnn_training_pytorch.

schleptech avatar schleptech commented on June 5, 2024

I read that Google colab has an outdated version, so I ran the following at the beginning of the notebook:

!pip install -q -U albumentations
!echo "$(pip freeze | grep albumentations) is successfully installed"

[https://colab.research.google.com/github/albumentations-team/albumentations_examples/blob/colab/tensorflow-example.ipynb#scrollTo=26f58a5d]

However, when I get to that step again, I am still getting the error

AttributeError: module 'albumentations' has no attribute 'Sequential'

from keypoint_rcnn_training_pytorch.

schleptech avatar schleptech commented on June 5, 2024

I got past this error by following these instructions:

It has something to do with the version of opencv-python-headless. So I updated that in the beginning and we got past the sequentials error with the following.

!pip install --upgrade --force-reinstall --no-deps albumentations
!pip install opencv-python-headless==4.5.5.62

from keypoint_rcnn_training_pytorch.

alexppppp avatar alexppppp commented on June 5, 2024

So, the error disappeared, correct?

P.S. This way of update is preferrable (from https://albumentations.ai/docs/getting_started/installation/):
If you already have some OpenCV distribution (such as opencv-python-headless, opencv-python, opencv-contrib-python or opencv-contrib-python-headless) installed in your Python environment, you can force Albumentations to use it by providing the --no-binary qudida,albumentations argument to pip, e.g.
pip install -U albumentations --no-binary qudida,albumentations

from keypoint_rcnn_training_pytorch.

schleptech avatar schleptech commented on June 5, 2024

Yes - updated my notebook to reflect your above suggestion.

Now when I get down to step 4, "4. Visualizing a random item from dataset", I get the following error:

SystemError: new style getargs format but argument is not a tuple

Seems to be an opencv error

Full output:
SystemError Traceback (most recent call last)
in ()
51 keypoints_original.append([kp[:2] for kp in kps])
52
---> 53 visualize(image, bboxes, keypoints, image_original, bboxes_original, keypoints_original)

in visualize(image, bboxes, keypoints, image_original, bboxes_original, keypoints_original)
27 for idx, kp in enumerate(kps):
28 image_original = cv2.circle(image_original, tuple(kp), 5, (255,0,0), 10)
---> 29 image_original = cv2.putText(image_original, " " + keypoints_classes_ids2names[idx], (kp), cv2.FONT_HERSHEY_SIMPLEX, 2, (255,0,0), 3, cv2.LINE_AA)
30
31 f, ax = plt.subplots(1, 2, figsize=(40, 20))

`

from keypoint_rcnn_training_pytorch.

alexppppp avatar alexppppp commented on June 5, 2024

Yes, the same for me

It can be fixed with changing this line:
image_original = cv2.putText(image_original, " " + keypoints_classes_ids2names[idx], (kp), cv2.FONT_HERSHEY_SIMPLEX, 2, (255,0,0), 3, cv2.LINE_AA)

to this line:
image_original = cv2.putText(image_original, " " + keypoints_classes_ids2names[idx], tuple(kp), cv2.FONT_HERSHEY_SIMPLEX, 2, (255,0,0), 3, cv2.LINE_AA)

Update: I've made this change in the original notebook

from keypoint_rcnn_training_pytorch.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.