Makehuman not working in arch linux - numpy 1.13.1

Tech support and suggestions forum. If you only have a basic question on how to get started, please use the "newbies" forum in the community section.

Moderator: joepal

Makehuman not working in arch linux - numpy 1.13.1

Postby artistafrustrado » Tue Sep 19, 2017 2:26 am

After a system upgrade a few months ago, makehuman stoped exporting mhx2. At first I thought it was a problem with the mhx2 plugin but when I tested exporting to other formats, I got the same error.

As far as I can tell it has something to do with numpy but I have no idea how to fix it.

Write MHX2 file /home/artista/makehuman/v1/exports/teste.mhx2
Exception during event onFileSelected
Traceback (most recent call last):
File "./core/events3d.py", line 211, in callEvent
method(event)
File "./apps/gui/guiexport.py", line 112, in onFileSelected
exporter.export(gui3d.app.selectedHuman, filename)
File "plugins/9_export_mhx2/__init__.py", line 55, in export
mh2mhx2.exportMhx2(filename("mhx2"), cfg)
File "plugins/9_export_mhx2/mh2mhx2.py", line 52, in exportMhx2
meshes = [obj.mesh.clone(cfg.scale, True) for obj in objects]
File "./core/module3d.py", line 160, in clone
self.filterMaskedVerts(other, update=False)
File "./core/module3d.py", line 311, in filterMaskedVerts
inverse_uv_idx[uv_idx] = np.arange(self.texco.shape[0], dtype=np.int32)
ValueError: shape mismatch: value array of shape (21334,) could not be broadcast to indexing result of shape (9416,)
artistafrustrado
 
Posts: 2
Joined: Tue Jul 28, 2015 7:03 am
Location: Curitiba / Brasil

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby joepal » Tue Sep 19, 2017 7:56 am

Do you happen to know which version of numpy was the last it worked with?

Anyway, it sounds like it is related to this bug: http://bugtracker.makehumancommunity.org/issues/1184
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby joepal » Tue Sep 19, 2017 8:19 am

Can you edit core/module3d.py and insert a few debug lines? The relevant block (around line 311) now reads:

Code: Select all
    # Filter out and remap unused UVs
    fuvs = self.fuvs[self.face_mask]
    uv_idx = np.unique(fuvs.reshape(-1))
    inverse_uv_idx = - np.ones(self.texco.shape[0], dtype=np.int32)
    inverse_uv_idx[uv_idx] = np.arange(self.texco.shape[0], dtype=np.int32)
    for i in xrange(self.vertsPerPrimitive):
        fuvs[:,i] = inverse_uv_idx[fuvs[:,i]]


Can you change it so that it reads

Code: Select all
    # Filter out and remap unused UVs
    fuvs = self.fuvs[self.face_mask]
    uv_idx = np.unique(fuvs.reshape(-1))
    print "\n\nTEXCO\n\n\n----"   # NEW LINE
    print self.texco.shape[0]     # NEW LINE
    print "----\n\n";             # NEW LINE
    inverse_uv_idx = - np.ones(self.texco.shape[0], dtype=np.int32)
    inverse_uv_idx[uv_idx] = np.arange(self.texco.shape[0], dtype=np.int32)
    for i in xrange(self.vertsPerPrimitive):
        fuvs[:,i] = inverse_uv_idx[fuvs[:,i]]


... start MH, add the clothing piece "female elegant suit", try to export via MHX2, and post the relevant sections of the console output (ie where it says "TEXCO") here?

Also, assuming this crashes as expected, can you retry the procedure, but also uncheck "hide faces under clothes" on the "clothes" tab, as well as set eyes to "none" on the "eyes" tab, and see if that makes anything different when exporting?
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby artistafrustrado » Wed Sep 20, 2017 2:46 am

This is what I got.

Write MHX2 file /home/artista/makehuman/v1/exports/debug.mhx2


TEXCO


----
21334
----


Exception during event onFileSelected
Traceback (most recent call last):
File "./core/events3d.py", line 219, in callEvent
method(event)
File "./apps/gui/guiexport.py", line 112, in onFileSelected
exporter.export(gui3d.app.selectedHuman, filename)
File "plugins/9_export_mhx2/__init__.py", line 55, in export
mh2mhx2.exportMhx2(filename("mhx2"), cfg)
File "plugins/9_export_mhx2/mh2mhx2.py", line 52, in exportMhx2
meshes = [obj.mesh.clone(cfg.scale, True) for obj in objects]
File "./core/module3d.py", line 160, in clone
self.filterMaskedVerts(other, update=False)
File "./core/module3d.py", line 314, in filterMaskedVerts
inverse_uv_idx[uv_idx] = np.arange(self.texco.shape[0], dtype=np.int32)
ValueError: shape mismatch: value array of shape (21334,) could not be broadcast to indexing result of shape (11981,)
artistafrustrado
 
Posts: 2
Joined: Tue Jul 28, 2015 7:03 am
Location: Curitiba / Brasil

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby joepal » Wed Sep 20, 2017 7:20 am

Ok, right now I have no other solution than downgrading numpy to 1.11.0, which is known to be working.
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby thedude22 » Sun Sep 24, 2017 10:22 pm

I've got the same problem also running Arch. I tried putting the numpy 1.11 module in the plugin folder and now I get this error instead.

I don't really know what I'm doing but I'm happy to help debug this if I can.

Exception during event onFileSelected
Traceback (most recent call last):
File "./core/events3d.py", line 211, in callEvent
method(event)
File "./apps/gui/guiexport.py", line 112, in onFileSelected
exporter.export(gui3d.app.selectedHuman, filename)
File "plugins/9_export_mhx2/__init__.py", line 51, in export
from . import mh2mhx2
File "plugins/9_export_mhx2/mh2mhx2.py", line 26, in <module>
import numpy as np
File "plugins/9_export_mhx2/numpy/__init__.py", line 193, in <module>
from . import core
File "plugins/9_export_mhx2/numpy/core/__init__.py", line 25, in <module>
from . import numeric
File "plugins/9_export_mhx2/numpy/core/numeric.py", line 407, in <module>
einsum = multiarray.einsum
AttributeError: 'module' object has no attribute 'einsum'
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby loki1950 » Sun Sep 24, 2017 11:52 pm

Numpy is not repeat not a plug-in it is a compiled module for Python so no surprise that putting it in the plug-in folder did not work you have to replace numpy 1.13.1 with numpy 1.11 which is a downgrade of a package that arch upgraded automatically not sure how one goes about this on arch but it will involve working in the system level files so root privileges are required for any changes you make.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo Ideapad 320-15ABR Win 10/Mint 19
User avatar
loki1950
 
Posts: 1219
Joined: Thu Dec 18, 2014 6:27 pm
Location: Ottawa,Ontario

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby thedude22 » Mon Sep 25, 2017 12:41 am

I understand that numpy is not a makehuman plugin. I actually use numpy pretty frequently, which is why I don't want to downgrade my system module. Yes, maybe I can set up a virtual environment to run an older version of numpy just for makehuman, but I'd have to figure out how to do that, and I already have a lot of things to work on. I havn't yet needed to use virtual environments for anything else.

I just thought that if I put the source code for numpy 1.11.0 in the same folder as the MHX2 exporter plugin then it would use that instead of the system numpy module which is a later version, and it appears to do just that. At least that's how I interpreted the stacktrace, but it looks like it couldn't import it for some reason though. Like I said I don't really know what I'm doing here.
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby thedude22 » Mon Sep 25, 2017 1:10 am

Ok apparently this plugin uses python 3? I discovered that my numpy 1.11.0 didn't work because it was the python 2.7 version. It's weird because the shell inside makehuman says it's 2.7 but apparently the plugin is not 2.7?

However this did not help solve the problem, as I'm just right back to the original shape mismatch error. It doesn't look like a problem with numpy, or at least using numpy 1.11.0 for python 3.5 didn't help. It might be a problem with the AUR version of makehuman. There is a bug complaint there. Hopefully it gets fixed.
thedude22
 
Posts: 10
Joined: Wed May 10, 2017 4:25 pm

Re: Makehuman not working in arch linux - numpy 1.13.1

Postby loki1950 » Mon Sep 25, 2017 3:20 am

Yes Python 2.7 is the right version for makehuman's stable version we are working on porting to Python 3 and updating from qt4 to qt5 as qt4 no longer has support but that branch is not yet ready for release.Maybe the AUR packager has miss read the proper dependencies for makehuman and assumed that we are using Python 3.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo Ideapad 320-15ABR Win 10/Mint 19
User avatar
loki1950
 
Posts: 1219
Joined: Thu Dec 18, 2014 6:27 pm
Location: Ottawa,Ontario

Next

Return to Bugs, problems and feature requests

Who is online

Users browsing this forum: No registered users and 1 guest