Giter Club home page Giter Club logo

Comments (7)

asafgal avatar asafgal commented on May 24, 2024

Hey Sean,
This is a python error, not related to the matlab engine.
Can you try this fix:

In the file anTraX/antrax/classifier.py, change line 513 to:

cw = class_weight.compute_class_weight(class_weight='balanced', classes =np.unique(FL.classes), y=FL.classes)

Then update the python code with pip install -e .
I am unable to test this myself currently, so let me know what happens!

from antrax.

Sean-Nolan6 avatar Sean-Nolan6 commented on May 24, 2024

Hi your first solution helped the first issue, but I'm currently trialing your other datasets to get a sense of how long my tests were. However when I try and run train on the V25 sample, it keeps coming up with the same error:

Epoch 1/3
124/1000 [==>...........................] - ETA: 5:54 - loss: 3.5632 - acc: 0.3478Traceback (most recent call last):
File "/home/sean/anaconda3/envs/test/bin/antrax", line 33, in
sys.exit(load_entry_point('antrax', 'console_scripts', 'antrax')())
File "/home/sean/Documents/AntTrax/anTraX/antrax/cli.py", line 659, in main
""")
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/sigtools/modifiers.py", line 158, in call
return self.func(*args, **kwargs)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/clize/runner.py", line 363, in run
ret = cli(*args)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/clize/runner.py", line 220, in call
return func(*posargs, **kwargs)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/clize/runner.py", line 262, in _cli
return func('{0} {1}'.format(name, command), *args)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/clize/runner.py", line 220, in call
return func(*posargs, **kwargs)
File "/home/sean/Documents/AntTrax/anTraX/antrax/cli.py", line 447, in train
c.train(examplesdir, ne=ne, aug_options=aug_options)
File "/home/sean/Documents/AntTrax/anTraX/antrax/classifier.py", line 533, in train
verbose=verbose)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1296, in fit_generator
steps_name='steps_per_epoch')
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_generator.py", line 221, in model_iteration
batch_data = _get_next_batch(generator)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training_generator.py", line 363, in _get_next_batch
generator_output = next(generator)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/data_utils.py", line 789, in get
six.reraise(*sys.exc_info())
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/six.py", line 719, in reraise
raise value
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/data_utils.py", line 783, in get
inputs = self.queue.get(block=True).get()
File "/home/sean/anaconda3/envs/test/lib/python3.7/multiprocessing/pool.py", line 657, in get
raise self._value
File "/home/sean/anaconda3/envs/test/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/tensorflow_core/python/keras/utils/data_utils.py", line 571, in get_index
return _SHARED_SEQUENCES[uid][i]
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/keras_preprocessing/image/iterator.py", line 65, in getitem
return self._get_batches_of_transformed_samples(index_array)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/keras_preprocessing/image/iterator.py", line 230, in _get_batches_of_transformed_samples
interpolation=self.interpolation)
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/keras_preprocessing/image/utils.py", line 114, in load_img
img = pil_image.open(io.BytesIO(f.read()))
File "/home/sean/anaconda3/envs/test/lib/python3.7/site-packages/PIL/Image.py", line 3009, in open
"cannot identify image file %r" % (filename if filename else fp)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f37b8629470>

from antrax.

asafgal avatar asafgal commented on May 24, 2024

Both errors are due to compatibility issue with 3rd party packages.
To fix your last error, reinstall the pillow package:

pip uninstall pillow
pip install pillow==8.4.0

Thanks for bringing this to my attention, I will update the requirement file accordingly.

from antrax.

Sean-Nolan6 avatar Sean-Nolan6 commented on May 24, 2024

Uninstalling and installing pillow doesn't seem to have fixed the issue, any other ideas to what it might be?

from antrax.

asafgal avatar asafgal commented on May 24, 2024

Can you verify the pillow version?
In a python console:

import PIL
print(PIL.__version__)

from antrax.

Sean-Nolan6 avatar Sean-Nolan6 commented on May 24, 2024

This is the error I get:
(test) sean@seans-ants:~$ import PIL
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 28, in
from CommandNotFound import CommandNotFound
File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in
from CommandNotFound.db.db import SqliteDatabase
File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in
import apt_pkg
ImportError: /usr/local/MATLAB/MATLAB_Runtime/v96/sys/os/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libapt-pkg.so.6.0)

from antrax.

asafgal avatar asafgal commented on May 24, 2024

from antrax.

Related Issues (20)

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.